An Example Cyborg.ipt File

Made By BotBot V71

If you want to see what iptscrae code looks like, here's a medium-sized example. As you can see, pressing a few BotBot buttons is probably eaiesr than coding this by hand and keeping track of all the cross-referenced GLOBALs, function initializations, and escape codes...


;Cyborg Script Serial# 71120399-1605030123-0209
;Created for XBot71 by The BotBot
;Portions Copyright (C)1999 Kevin Bjorke/National Pixel Products
;Support: http://www.botzilla.com/house/book/askX.html
;hexkey 06198f1b1c1d1e2a333e484c4e4f5354555657586164797f88898b

ON SIGNON {
	ICameFrom       GLOBAL
	a2W     GLOBAL
	a3W     GLOBAL
	aWho    GLOBAL
	autoPos GLOBAL
	autoX   GLOBAL
	autoY   GLOBAL
	defProp GLOBAL
	doList  GLOBAL
	egoOff  GLOBAL
	initOK  GLOBAL
	mark    GLOBAL
	noHoney GLOBAL
	no_wisp GLOBAL
	prefname	GLOBAL
	rcFlag  GLOBAL
	timeBase	GLOBAL
	timezone	GLOBAL
	whenFing	GLOBAL
	whoFing GLOBAL
	aps     GLOBAL
	auto_pos	GLOBAL
	ctime   GLOBAL
	n_prop  GLOBAL
	t_or_f  GLOBAL
	time_now	GLOBAL
	whisp_all       GLOBAL
	"Dr.X"  ICameFrom =
	0       autoPos =
	9       defProp =
	1       doList =
	1       egoOff =
	1       initOK =
	"********* MARKER ***********"  mark =
	1       noHoney =
	1       no_wisp =
	"TheMan"	prefname =
	1       rcFlag =
	DATETIME	timeBase =
	-8      timezone =
	0       whenFing =
	0       whoFing =
	{
		autoPos GLOBAL
		autoX   GLOBAL
		autoY   GLOBAL
		autoY =
		autoX =
		autoY 0 == autoX 0 == AND NOT autoPos =
	} aps DEF
	{
		autoPos GLOBAL
		autoX   GLOBAL
		autoY   GLOBAL
		"\x20" fc =
		{
			DUP tmp =
			{
				"$1" GREPSUB fc =
			} tmp "^(.)" GREPSTR IF
			{
				"@"
				POSX autoX + apt =
				{ 0 apt = } apt 0 < IF
				{ 511 apt = } apt 511 > IF
				apt ITOA &
				"," &
				POSY autoY + apt =
				{ 0 apt = } apt 0 < IF
				{ 383 apt = } apt 383 > IF
				apt ITOA &
				" " &
				SWAP &
			} fc "\x60" == NOT
			    fc "\x3d" == NOT AND
			    fc "\x40" == NOT AND
			    fc "\x3b" == NOT AND
			    fc "\x7e" == NOT AND
			    WHOTARGET WHOME == NOT AND IF
			{
				tmp "^.(.*)" GREPSTR POP
				"$1" GREPSUB tmp =
				POP
				tmp
			} fc "\x3d" == IF
		} autoPos IF
	} auto_pos DEF
	{
		timezone	GLOBAL
		{
			DATETIME 86400 % t =
			t 3600 / timezone + h =
		} {
			DATETIME 2147483647 + 86400 % 11647 + 86400 %
t =
			t 3600 / h =
		} DATETIME 0 >= IFELSE
		{ 24 h -= } h 24 > IF
		{ 24 h += } h 0 < IF
		h ITOA ":" & 
		t 3600 % 60 / m =
		{ "0" & } m 10 < IF m ITOA &
		":" & 
		t 60 %  s =
		{ "0" & } s 10 < IF s ITOA &
	} ctime DEF
	{
		ct =
		nm =
		1 i =
		[
			{
				nm i ITOA &
				i ++
			} { i ct <= } WHILE
		] SETPROPS
	} n_prop DEF
	{
		LOWERCASE DUP "on" == SWAP "^[yt+]" GREPSTR OR
	} t_or_f DEF
	{
		timeBase	GLOBAL
		DATETIME timeBase -
	} time_now DEF
	{
		msg     =
		NBRROOMUSERS    r       =
		"Whispering \x22" msg & "\x22 to all" & STATUSMSG
		{
			0       i       =
			{
				{
					i ROOMUSER WHONAME ":" &
LOGMSG
					msg i ROOMUSER PRIVATEMSG
				} i ROOMUSER WHOME == NOT
				    i ROOMUSER WHOTARGET == NOT AND IF
				i ++
			} { i r < } WHILE
			{ 0 0 MOVE } 120 ALARMEXEC
		} msg "" == NOT IF
	} whisp_all DEF
	"schwing!!" SAY
	defProp MACRO
}

ON ENTER {
	ctime   GLOBAL
	doList  GLOBAL
	initOK  GLOBAL
	t_or_f  GLOBAL
	time_now	GLOBAL
	{ "Caution: Bogus INIT!" STATUSMSG
		"See http://www.botzilla.com/house/hspain.html" LOGMSG
		EXIT } initOK NOT IF
	{
		{
			"`list -k -n" SAY
		} {
			NBRROOMUSERS n =
			0 i =
			"**** " n ITOA & " Users:" & LOGMSG
			{
				"**** " i ROOMUSER WHONAME &
				" (" & i ROOMUSER ITOA & ")" & LOGMSG
				i ++
			} { i n < } WHILE
		} ISWIZARD IFELSE
	} NBRROOMUSERS 1 > doList AND IF
	"Went to " ROOMID ITOA & " " ROOMNAME & " at " ctime EXEC & &
& LOGMSG
	{ "\"" ")amen Re's " ROOMNAME & " peeps" & & "\" SAY" &
		STRTOATOM 180 ALARMEXEC } NBRROOMUSERS 1 > IF
}

ON INCHAT {
	ctime   GLOBAL
	initOK  GLOBAL
	time_now	GLOBAL
	whenFing	GLOBAL
	whoFing GLOBAL
	CHATSTR LOWERCASE lowchat =
	{
		"$1" GREPSUB lowchat =
	} lowchat "^@[0-9, ]*(.*)" GREPSTR IF
	{
		{
		    WHOCHAT WHONAME w =
		    {
			"`list -k -d " w & SAY
			"`list -p -o " w & SAY
		    } {
			"`mute " w & SAY
			"^Automuting " w & SAY
			{ 0 0 MOVE } 240 ALARMEXEC
		    } ISWIZARD IFELSE
		} "$1" GREPSUB "folk" == NOT IF
	} lowchat "(f[aeiou*][ckq*][qk*]") GREPSTR IF
	{ EXIT } initOK NOT IF
	{
		{
			"\x3bfinger" WHOCHAT PRIVATEMSG
		} whoFing WHOCHAT == NOT IF
		"Conqueror of the Scots, " USERNAME & "" &
		WHOCHAT PRIVATEMSG
		WHOCHAT whoFing =
		DATETIME whenFing =
	} lowchat "finger" ==
	  lowchat "\x3bfinger" == OR
	  DATETIME whenFing - 5 > AND
	  WHOCHAT WHOME == NOT AND IF
}

ON OUTCHAT {
	ICameFrom       GLOBAL
	a2W     GLOBAL
	a3W     GLOBAL
	aWho    GLOBAL
	aps     GLOBAL
	auto_pos	GLOBAL
	ctime   GLOBAL
	egoOff  GLOBAL
	initOK  GLOBAL
	mark    GLOBAL
	n_prop  GLOBAL
	noHoney GLOBAL
	no_wisp GLOBAL
	rcFlag  GLOBAL
	t_or_f  GLOBAL
	time_now	GLOBAL
	whisp_all       GLOBAL
	"Dr.X" ICameFrom =
	surf GLOBAL 0 surf =
	CHATSTR LOWERCASE lowchat =
	{
		"\x3ballscray \x7b \x22Mac\x22 \x7d \x7b \x22PC\x22
\x7d DATETIME 0 < IFELSE SAY" SAY
		"" CHATSTR =
	} lowchat "jihad" == IF
	{
		"\x22"
		{
		    TOPPROP ITOA &
		    MOUSEPOS DROPPROP
		    { " " & } TOPPROP IF
		} { TOPPROP } WHILE
		"\x22" & LOGMSG
		"" CHATSTR =
	} lowchat "dump" == IF
	{
		"$1" GREPSUB ATOI nx =
		"$2" GREPSUB ATOI ny =
		{
		    "Please specify rows and columns" LOCALMSG
		} nx ny * 1 < IF
		{
		    {
			NBRUSERPROPS nx ny * - ITOA " props left" &
LOCALMSG
		    } nx ny * NBRUSERPROPS == NOT IF
		    MOUSEPOS 22 + 3 ny - 22 * - y = 22 + 3 nx - 22 * -
x =
		    { 468 x = } x 468 > IF
		    { 340 y = } y 340 > IF
		    { nx 1 - 44 * x = } nx 1 - 44 * x > IF
		    { ny 1 - 44 * y = } ny 1 - 44 * y > IF
		    0 j = {
			0 i = {
			    x i 44 * - y j 44 * - DROPPROP i ++
			} { i nx < } WHILE
			j ++
		    } { j ny < } WHILE
		} {
		    "You only have " NBRUSERPROPS ITOA & " props, not
" &
		    nx ny * ITOA & LOCALMSG
		} nx ny * NBRUSERPROPS <= IFELSE
		"" CHATSTR =
	} CHATSTR "^hang ([1-9]) ([1-9])" GREPSTR IF
	{
		{
			WHOTARGET WHOPOS SETPOS
		} {
			"Err: You must select someone" STATUSMSG
		} WHOTARGET IFELSE
		"" CHATSTR =
	} lowchat "align" == IF
	{
		CLEARLOOSEPROPS PAINTCLEAR
		"" CHATSTR =
	} CHATSTR "^\x3b*clean$" GREPSTR IF
	{
		"\x3b Put the following into a spot script:" LOGMSG
		"ON SELECT \x7b" LOGMSG
		NBRUSERPROPS n =
		{
		    0 i =
		    "  \x5b"
		    {
			" " i USERPROP ITOA & &
			i ++
		    } { i n < } WHILE
		    " \x5d SETPROPS" & LOGMSG
		} n IF
		"\x7d" LOGMSG
		"" CHATSTR =
	} lowchat "propspot" == IF
	{
		"$1" GREPSUB MOUSEPOS SAYAT
		"" CHATSTR =
	} CHATSTR "^msay (.*)$" GREPSTR IF
	{
		MOUSEPOS SETPOS
		"" CHATSTR =
	} lowchat "mpos" == IF
	{ EXIT } initOK NOT IF
	{
		"$1" GREPSUB s = 0 i =
		{ s i ROOMUSER WHOPOS SAYAT i ++ { 16 RANDOM SETCOLOR
} rcFlag IF }
		{ i NBRROOMUSERS < } WHILE
		0 0 MOVE
		"" CHATSTR =
	} CHATSTR "^\x3b*allsay (.*)" GREPSTR IF
	{
		"$1" GREPSUB cost =
		"$2" GREPSUB ATOI x =
		{
			cost x n_prop EXEC
		} {
			"odd, I got \"" cost & "\" " & x ITOA &
STATUSMSG
		} x 0 > x 10 < AND IFELSE
		"" CHATSTR =
	} CHATSTR "^\x3b*np ([a-zA-Z][^ ]*) ([1-9])" GREPSTR IF
	{
		mark STATUSMSG
		
		"" CHATSTR =
	} lowchat "marker" == IF
	{
		"$1" GREPSUB CHATSTR =
		{
		    WHOTARGET a2W =
		    ".Asides to " a2W WHONAME & STATUSMSG
		} {
		    {
			{
			    ".Asides to " a2W WHONAME & STATUSMSG
			} {
			    CHATSTR a2W PRIVATEMSG
			} CHATSTR "" == IFELSE
		    } {
			".Aside to Who???" LOCALMSG
		    } a2W IFELSE
		    "" CHATSTR =
		} WHOTARGET IFELSE
	} CHATSTR "^[.](.*)" GREPSTR IF
	{
		"$1" GREPSUB CHATSTR =
		{
		    WHOTARGET a3W =
		    "?Asides to " a3W WHONAME & STATUSMSG
		} {
		    {
			{
			    "?Asides to " a3W WHONAME & STATUSMSG
			} {
			    CHATSTR a3W PRIVATEMSG
			} CHATSTR "" == IFELSE
		    } {
			"?Aside to Who???" LOCALMSG
		    } a3W IFELSE
		    "" CHATSTR =
		} WHOTARGET IFELSE
	} CHATSTR "^?(.*)" GREPSTR IF
	{
		"$1" GREPSUB CHATSTR =
		{
		    WHOTARGET aWho =
		    ",Asides to " aWho WHONAME & STATUSMSG
		} {
		    {
			{
			    ",Asides to " aWho WHONAME & STATUSMSG
			} {
			    CHATSTR aWho PRIVATEMSG
			} CHATSTR "" == IFELSE
		    } {
			",Aside to Who???" LOCALMSG
		    } aWho IFELSE
		    "" CHATSTR =
		} WHOTARGET IFELSE
	} CHATSTR "^,(.*)" GREPSTR IF
	{
		{
			MOUSEPOS y = x =
			{
				0 0
			} {
				x POSX - y POSY -
			} y 1 < y 382 > OR
			    x 1 < x 510 > OR OR IFELSE
		} {
			"$1" GREPSUB ATOI
			"$2" GREPSUB ATOI
		} "$1" GREPSUB "" == IFELSE
		aps EXEC
		"" CHATSTR =
	} CHATSTR "^\x3b*ap *(-*[0-9]*) *(-*[0-9]*)" GREPSTR IF
	{
		"$1" GREPSUB whisp_all EXEC
		"" CHATSTR =
	} CHATSTR "^\x3bw (.*)" GREPSTR IF
	{
		"$1" GREPSUB t =
		{
			rcFlag NOT rcFlag =
		} {
			t t_or_f EXEC rcFlag =
		} t "" == IFELSE
		"" CHATSTR =
		"rcolor "
		{ "On" } { "Off" } rcFlag IFELSE & STATUSMSG
	} lowchat "rcolor *(.*)" GREPSTR IF
	{
		"Status"
		{
			"\x0dBalloon Pos is On" &
		} autoPos IF
		"\x0dMy Prefered Name is \"" & prefname & "\"" &
		{
			"\x0dRColor is On" &
		} rcFlag IF
		"\x0dTime: " & ctime EXEC & " (" &
		time_now EXEC 30 + 60 / ITOA &
		" minutes)" &
		LOGMSG
		"XBot V71: Serial# 71120399-1605030123-0209" STATUSMSG
		"" CHATSTR =
	} lowchat "stats" == IF
	{
		"http://www.botzilla.com/cgi-bin//bothelp.pl" NETGOTO
		"" CHATSTR =
	} CHATSTR "??" == CHATSTR "help" == OR IF
	{
	    "$1" GREPSUB SAY
	    "" CHATSTR =
	} CHATSTR "^<(.*)" GREPSTR IF
	{ 16 RANDOM SETCOLOR } rcFlag IF
	{
		CHATSTR auto_pos EXEC CHATSTR =
	} CHATSTR "" == NOT IF
}

;end of cyborg.ipt Ser# 71120399-1605030123-0209


Iptscrae Beginners Page
House o Bots
BotBot