alias msgplayers { set %i 1 while (%i <= 10) { if ($len($var(%pug_pugready*,%i)) > 0) { timer 1 $calc(%i * 2) /msg $replace($replace($var(%pug_pugready*,%i),pug_pugready, ),%,) $replace(%pug_mask,*,Pug info: %pug_pugvent) } inc %i } } alias postpug { msg %pug_pugchan $replace(%pug_mask,*,Maxplayers: %pug_maxplayers ¤ Players Ready: %pug_ready ¤ Players Needed: $calc(%pug_maxplayers - (%pug_ready)) ¤ Latest player to ready: %pug_puglatest ¤ Pug Starter: %pug_pugstarter ¤ Pug Start Time: %pug_pugtime ¤ Pug Totals: %pug_total ¤ Trigger to ready up: %pug_trigger $+ add $+ ) var %i = 1, %msg | while ($var(%pug_pugready*,%i)) { %msg = %msg $remove($v1,$+(%,pug_pugready)) | inc %i } if (%msg) { msg %pug_pugchan $replace(%pug_mask,*,%msg) } } alias stoppug { unset %pug_pug | unset %pug_puglatest | unset %pug_pugtime | unset %pug_pugready* | unset %pug_ready } on *:LOAD: { unset %pug_pug* | unset %pug_ready* | unset %pug_maxplayers | unset %pug_ready | set %pug_trigger ! | set %pug_pugchan #csspug4 | set %pug_master_pass if (%pug_pugvent == $null) { set %pug_pugvent Pug information not set } if (%pug_mask == $null) { set %pug_mask * } } on *:TEXT:$(%pug_trigger $+ startpug*):%pug_pugchan: { if (%pug_admin [ $+ [ $address($nick,2) ] ] != 1) { notice $nick Sorry you lack access to this command } elseif (%pug_pug == 1) { notice $nick There is already a pug started } elseif ($2 == $null) { notice $nick You did not enter 10 or 5 man } elseif ($2 != 10) && ($2 != 5) { notice $nick You did not enter 10 or 5 man } elseif ($2 == 5) { notice $nick Pug started | set %pug_pugstarter $nick | set %pug_pugtime $asctime(h:nn tt) | set %pug_pug 1 | set %pug_ready 0 | set %pug_maxplayers $2 | postpug } elseif ($2 == 10) { inc %pug_total | notice $nick Pug started | set %pug_pugstarter $nick | set %pug_pugtime $asctime(h:nn tt) | set %pug_puglatest None | set %pug_pug 1 | set %pug_ready 0 | set %pug_maxplayers $2 | postpug } } on *:TEXT:$(%pug_trigger $+ setmask*):%pug_pugchan: { if (%pug_admin [ $+ [ $address($nick,2) ] ] != 1) { notice $nick Sorry you do not have access to this command } elseif (%pug_admin [ $+ [ $address($nick,2) ] ] == 1) { notice $nick Successfully updated commands mask to $2- | set %pug_mask $2- } else { notice $nick Error. } } on *:TEXT:$(%pug_trigger $+ puginfo*):?: { if (%pug_admin [ $+ [ $address($nick,2) ] ] != 1) { notice $nick Sorry you lack access to this command } elseif ($2 == $null) { notice $nick You forgot to enter server info } elseif ($2 != $null) { set %pug_pugvent $2- | notice $nick Pug Info has been set to: $2- } } on *:TEXT:$(%pug_trigger $+ endpug):%pug_pugchan: { if (%pug_admin [ $+ [ $address($nick,2) ] ] != 1) { notice $nick Sorry you lack access to this command } elseif (%pug_pug != 1) { notice $nick There is no pug in progress } elseif (%pug_pug == 1) { notice $nick Pug ended | unset %pug_pug | unset %pug_puglatest | unset %pug_pugtime | unset %pug_pugready* | unset %pug_ready } } on *:TEXT:$(%pug_trigger $+ pug):%pug_pugchan: { if (%pug_pug != 1) { notice $nick There is no pug in progress } else { postpug } } on *:TEXT:$(%pug_trigger $+ addadmin*):?: { if (%pug_admin [ $+ [ $address($nick,2) ] ] == 1) { if ($2 ison %pug_pugchan) { if ($3 == %pug_master_pass) { set %pug_admin $+ $address($2,2) 1 | notice $nick User has been added with address $address($2,2) to admin list } else { notice $nick Invalid master password } } else { notice $nick User $2 is not in %pug_pugchan } } } on *:TEXT:$(%pug_trigger $+ deladmin*):?: { if (%pug_admin [ $+ [ $address($nick,2) ] ] == 1) { if (%pug_admin [ $+ [ $address($2,2) ] ] == 1) { if ($3 == %pug_master_pass) { unset %pug_admin $+ $address($2,2) | notice $nick Successfully removed admin from bot } else { notice $nick Invalid master password } } else { notice $nick User needs to be in current channel to remove } } } on *:TEXT:$(%pug_trigger $+ addme):?: { if ($var(%pug_admin*,1) == $null) { set %pug_admin $+ $address($nick,2) 1 | notice $nick You have been added as the master admin, current master password is %pug_master_pass } else { notice $nick There are already admins added to the bot } } on *:NICK: { if ($nick == %pug_puglatest) { set %pug_puglatest $newnick | postpug } } on *:NICK: { if (%pug_pugready [ $+ [ $nick ] ] == 1) { unset %pug_pugready $+ $nick | set %pug_pugready $+ $newnick 1 } } on *:PART:%pug_pugchan: { if (%pug_pugready [ $+ [ $nick ] ] == 1) { unset %pug_pugready $+ $nick | dec %pug_ready 1 | msg $nick You have been removed from the ready list for leaving %pug_pugchan | postpug } } on *:QUIT: { if (%pug_pugready [ $+ [ $nick ] ] == 1) { unset %pug_pugready $+ $nick | dec %pug_ready 1 | postpug } } on *:TEXT:$(%pug_trigger $+ settrigger*):%pug_pugchan: { if (%pug_admin [ $+ [ $address($nick,2) ] ] != 1) { notice $nick Sorry you do not have access to this command } elseif ($2 == $null) { notice $nick You did not enter a value } elseif (%pug_admin [ $+ [ $address($nick,2) ] ] == 1) { notice $nick Successfully updated trigger to $2 | set %pug_trigger $2 | set %pug_trigger $2 } } on *:TEXT:*:%pug_pugchan: { if (($1 == %pug_trigger $+ add) || ($1 == %pug_trigger $+ add)) { if (%pug_pug != 1) { notice $nick There is no pug in progress } elseif (%pug_ready >= %pug_maxplayers) { notice $nick There are already %pug_ready $+ / $+ %pug_maxplayers players ready } elseif (%pug_pugready [ $+ [ $nick ] ] == 1) { notice $nick You are already ready } elseif (%pug_ready < %pug_maxplayers) { notice $nick You are now ready to pug | set %pug_puglatest $nick | notice $nick $replace(%pug_mask,*,%pug_pugvent) | set %pug_pugready $+ $nick 1 | inc %pug_ready 1 | postpug if (%pug_ready == %pug_maxplayers) { msgplayers | msg %pug_pugchan $replace(%pug_mask,*,Pug is now ready ¬ Info being resent) | stoppug } } } if (($1 == %pug_trigger $+ remove) || ($1 == %pug_trigger $+ remove)) { if (%pug_pug != 1) { notice $nick There is no pug in progress } elseif (%pug_pugready [ $+ [ $nick ] ] != 1) { notice $nick You were never ready } elseif (%pug_pugready [ $+ [ $nick ] ] == 1) { notice $nick Removed from ready list | unset %pug_pugready $+ $nick | dec %pug_ready 1 | postpug } } }