Apr 25, 2006 05:44
Password Of The Day Auto-Update Script
################################################################################################
This script can snag passwords from the bots specific by their nick's as specified in the "updatebotnick" alias. Here's the code. Original structure by jhood and Jason#8 with additional functionality, comments, and variable naming conventions by yours truly.
[code:1:62124ac05b];; *** WINBOLO PASSWORD OF THE DAY AUTO-UPDATE SCRIPT FOR ANYBOT ***
;; *** Version 1.4 Standalone Version ***
;; *** Written By Jason#8, Jhood, and Sticks ***
;; *** For Help or Support, Contact Me in IRC or Send me an Email ***
;; *** at Racer7 *AT* gmail.com ***
;; To add a new bot all you have to do is add a similar line to the alias
;; of 'updatebotnick' and increment the number by one. For example, to
;; add another bot named 'East' you would write the following line at the
;; end of the 'updatebotnick' alias:
;;
;; set %potd.bot09 East
;;
;; Also, you need to modify one line of code, which is the first if() statement
;; in the on TEXT event that looks for * map*. Simply add the following inside
;; the last parenthesis (including a space before the double pipes -- the vertical
;; bars):
;;
;; || ($1 == %potd.bot09)
;;
;; This alias is used to update and assign the bot names to particular variables as
;; well as update the channel in which this bot should watch. Instead of having to
;; search through the whole script looking for each reference of a particular bot or
;; the channel, you can simply change their values here and they will reflect later
;; on in the script.
;; To run this alias simply type "/updatebotnick" in any window without quotes.
alias updatebotnick {
echo -a ::: Updating bot nickname's and other variables...
set %potd.channel #winbolo
set %potd.bot01 alexmbot
set %potd.bot02 acrobot
set %potd.bot03 boombot
set %potd.bot04 bottie
set %potd.bot05 bluebot
set %potd.bot06 nycbot
set %potd.bot07 renbot
set %potd.bot08 pawnybot
echo -a ::: Update done!
}
;; An explanation on the syntax used: what is happening here is that
;; the %potd.botNN variable (which hold the names of bots) is being
;; evaluated. The $+ identifier concatenates what is on the left
;; hand side with what is on the right hand side. The brackets simply
;; allow variables to be evaluated and everything to be parsed nicely.
;; Thus, after the set operation executes you have something that looks
;; like the following step by step..
;; [ % $+ [ alexmbot ] $+ pass ]
;; [ %alexmbotpass ]
;; %alexmbotpass
on *:TEXT:* - password*:%potd.channel: {
;; Player used a custom password and the bot they wished to map it is
;; currently reporting the game creation.
if ((%potd.customPassword == yes) && (%potd.botUsed == $nick)) {
echo %potd.channel ::: Halting password processing due to custom password
halt
}
echo %potd.channel ::: Processing password from $nick $+ ...
set %pass.string $1-
;; The $left() identifier will strip the trailing control code from the token
set %password $left($gettok(%pass.string, -1, 32), -1)
if ($nick == %potd.bot01) set [ % $+ [ %potd.bot01 ] $+ pass ] %password
elseif ($nick == %potd.bot02) set [ % $+ [ %potd.bot02 ] $+ pass ] %password
elseif ($nick == %potd.bot03) set [ % $+ [ %potd.bot03 ] $+ pass ] %password
elseif ($nick == %potd.bot04) set [ % $+ [ %potd.bot04 ] $+ pass ] %password
elseif ($nick == %potd.bot05) set [ % $+ [ %potd.bot05 ] $+ pass ] %password
elseif ($nick == %potd.bot06) set [ % $+ [ %potd.bot06 ] $+ pass ] %password
elseif ($nick == %potd.bot07) set [ % $+ [ %potd.bot07 ] $+ pass ] %password
elseif ($nick == %potd.bot08) set [ % $+ [ %potd.bot08 ] $+ pass ] %password
echo %potd.channel ::: Password added!
}
on *:TEXT:* map*:%potd.channel: {
echo %potd.channel ::: $nick is starting a game
;; First word user said is a bot's name, which means they are trying to spawn a map.
if (($1 == %potd.bot01) || ($1 == %potd.bot02) || ($1 == %potd.bot03) || ($1 == %potd.bot04) || ($1 == %potd.bot05) || ($1 == %potd.bot06) || ($1 == %potd.bot07) || ($1 == %potd.bot08)) {
if ($2 == mappw) {
set %potd.botUsed $1
set %potd.customPassword yes
}
elseif ($2 == map) {
set %potd.botUsed $1
set %potd.customPassword no
}
}
}
;; Please see the mIRC help file to explain how $eval() works.
on *:TEXT:potd:%potd.channel: {
msg %potd.channel Passwords are as follows:
if (%potd.bot01 ison %potd.channel) msg %potd.channel %potd.bot01 => $eval(% $+ %potd.bot01 $+ pass, 2)
if (%potd.bot02 ison %potd.channel) msg %potd.channel %potd.bot02 => $eval(% $+ %potd.bot02 $+ pass, 2)
if (%potd.bot03 ison %potd.channel) msg %potd.channel %potd.bot03 => $eval(% $+ %potd.bot03 $+ pass, 2)
if (%potd.bot04 ison %potd.channel) msg %potd.channel %potd.bot04 => $eval(% $+ %potd.bot04 $+ pass, 2)
if (%potd.bot05 ison %potd.channel) msg %potd.channel %potd.bot05 => $eval(% $+ %potd.bot05 $+ pass, 2)
if (%potd.bot06 ison %potd.channel) msg %potd.channel %potd.bot06 => $eval(% $+ %potd.bot06 $+ pass, 2)
if (%potd.bot07 ison %potd.channel) msg %potd.channel %potd.bot07 => $eval(% $+ %potd.bot07 $+ pass, 2)
if (%potd.bot08 ison %potd.channel) msg %potd.channel %potd.bot08 => $eval(% $+ %potd.bot08 $+ pass, 2)
}[/code:1:62124ac05b]
This script can snag passwords from the bots specific by their nick's as specified in the "updatebotnick" alias. Here's the code. Original structure by jhood and Jason#8 with additional functionality, comments, and variable naming conventions by yours truly.
[code:1:62124ac05b];; *** WINBOLO PASSWORD OF THE DAY AUTO-UPDATE SCRIPT FOR ANYBOT ***
;; *** Version 1.4 Standalone Version ***
;; *** Written By Jason#8, Jhood, and Sticks ***
;; *** For Help or Support, Contact Me in IRC or Send me an Email ***
;; *** at Racer7 *AT* gmail.com ***
;; To add a new bot all you have to do is add a similar line to the alias
;; of 'updatebotnick' and increment the number by one. For example, to
;; add another bot named 'East' you would write the following line at the
;; end of the 'updatebotnick' alias:
;;
;; set %potd.bot09 East
;;
;; Also, you need to modify one line of code, which is the first if() statement
;; in the on TEXT event that looks for * map*. Simply add the following inside
;; the last parenthesis (including a space before the double pipes -- the vertical
;; bars):
;;
;; || ($1 == %potd.bot09)
;;
;; This alias is used to update and assign the bot names to particular variables as
;; well as update the channel in which this bot should watch. Instead of having to
;; search through the whole script looking for each reference of a particular bot or
;; the channel, you can simply change their values here and they will reflect later
;; on in the script.
;; To run this alias simply type "/updatebotnick" in any window without quotes.
alias updatebotnick {
echo -a ::: Updating bot nickname's and other variables...
set %potd.channel #winbolo
set %potd.bot01 alexmbot
set %potd.bot02 acrobot
set %potd.bot03 boombot
set %potd.bot04 bottie
set %potd.bot05 bluebot
set %potd.bot06 nycbot
set %potd.bot07 renbot
set %potd.bot08 pawnybot
echo -a ::: Update done!
}
;; An explanation on the syntax used: what is happening here is that
;; the %potd.botNN variable (which hold the names of bots) is being
;; evaluated. The $+ identifier concatenates what is on the left
;; hand side with what is on the right hand side. The brackets simply
;; allow variables to be evaluated and everything to be parsed nicely.
;; Thus, after the set operation executes you have something that looks
;; like the following step by step..
;; [ % $+ [ alexmbot ] $+ pass ]
;; [ %alexmbotpass ]
;; %alexmbotpass
on *:TEXT:* - password*:%potd.channel: {
;; Player used a custom password and the bot they wished to map it is
;; currently reporting the game creation.
if ((%potd.customPassword == yes) && (%potd.botUsed == $nick)) {
echo %potd.channel ::: Halting password processing due to custom password
halt
}
echo %potd.channel ::: Processing password from $nick $+ ...
set %pass.string $1-
;; The $left() identifier will strip the trailing control code from the token
set %password $left($gettok(%pass.string, -1, 32), -1)
if ($nick == %potd.bot01) set [ % $+ [ %potd.bot01 ] $+ pass ] %password
elseif ($nick == %potd.bot02) set [ % $+ [ %potd.bot02 ] $+ pass ] %password
elseif ($nick == %potd.bot03) set [ % $+ [ %potd.bot03 ] $+ pass ] %password
elseif ($nick == %potd.bot04) set [ % $+ [ %potd.bot04 ] $+ pass ] %password
elseif ($nick == %potd.bot05) set [ % $+ [ %potd.bot05 ] $+ pass ] %password
elseif ($nick == %potd.bot06) set [ % $+ [ %potd.bot06 ] $+ pass ] %password
elseif ($nick == %potd.bot07) set [ % $+ [ %potd.bot07 ] $+ pass ] %password
elseif ($nick == %potd.bot08) set [ % $+ [ %potd.bot08 ] $+ pass ] %password
echo %potd.channel ::: Password added!
}
on *:TEXT:* map*:%potd.channel: {
echo %potd.channel ::: $nick is starting a game
;; First word user said is a bot's name, which means they are trying to spawn a map.
if (($1 == %potd.bot01) || ($1 == %potd.bot02) || ($1 == %potd.bot03) || ($1 == %potd.bot04) || ($1 == %potd.bot05) || ($1 == %potd.bot06) || ($1 == %potd.bot07) || ($1 == %potd.bot08)) {
if ($2 == mappw) {
set %potd.botUsed $1
set %potd.customPassword yes
}
elseif ($2 == map) {
set %potd.botUsed $1
set %potd.customPassword no
}
}
}
;; Please see the mIRC help file to explain how $eval() works.
on *:TEXT:potd:%potd.channel: {
msg %potd.channel Passwords are as follows:
if (%potd.bot01 ison %potd.channel) msg %potd.channel %potd.bot01 => $eval(% $+ %potd.bot01 $+ pass, 2)
if (%potd.bot02 ison %potd.channel) msg %potd.channel %potd.bot02 => $eval(% $+ %potd.bot02 $+ pass, 2)
if (%potd.bot03 ison %potd.channel) msg %potd.channel %potd.bot03 => $eval(% $+ %potd.bot03 $+ pass, 2)
if (%potd.bot04 ison %potd.channel) msg %potd.channel %potd.bot04 => $eval(% $+ %potd.bot04 $+ pass, 2)
if (%potd.bot05 ison %potd.channel) msg %potd.channel %potd.bot05 => $eval(% $+ %potd.bot05 $+ pass, 2)
if (%potd.bot06 ison %potd.channel) msg %potd.channel %potd.bot06 => $eval(% $+ %potd.bot06 $+ pass, 2)
if (%potd.bot07 ison %potd.channel) msg %potd.channel %potd.bot07 => $eval(% $+ %potd.bot07 $+ pass, 2)
if (%potd.bot08 ison %potd.channel) msg %potd.channel %potd.bot08 => $eval(% $+ %potd.bot08 $+ pass, 2)
}[/code:1:62124ac05b]