; Functionality - Functionality - Functionality - Functionality - Functionality - Functionality - Functionality - Functionality ; Self configuration prompt alias initialize { ; Define all internal variables set %current_channel_addition = '#php' set %channel_autojoin_count 1 ; Get the users X username set %x_username $input(X (CService) Username:,evgu,Initializing new installation..,%x_username) ; Get the users X password set %x_password $input(X (CService) Password:,evgu,Initializing new installation..,%x_password) ; Get the users connection speed (1-10) set %x_connection_speed $input(Average connection speed ([Fastest] 1-10 [Slowest]):,evgu,Initializing new installation..,%x_connection_speed) ; Define Autojoin channels until empty entry is given while ((%channel_autojoin_count < 20) && ($len(%current_channel_addition) > 0)) { ; Get an entry from the user set %current_channel_addition $input($eval($+(Specify autojoin channel,$chr(32),$chr(35),%channel_autojoin_count,$chr(32),[Enter or Cancel to finish]:),2),evgu,Initializing new installation..,$eval($+(%,autojoin.,%channel_autojoin_count),2)) if ($len(%current_channel_addition) > 0 && %current_channel_addition != $null) { set $+(%,autojoin.,%channel_autojoin_count) %current_channel_addition set %channel_autojoin_count $calc(%channel_autojoin_count + 1); } else break } ; If auth details were both specified enable auto auth ; If autojoin channels were specified enable auto join ; Initiation complete set %initialized 1 } // Self X commands alias voiceme .msg x voice $chan $me alias opme .msg x op $chan $me alias deopme .msg x deop $chan $me alias setTopic .timer 1 1 .opme | .timer 1 2 .topic $chan $1- | .timer 1 3 .deopme ; X (Undernet) commands - Basic alias xkb .msg x kick #php $$1 $2- | /msg x ban #php $$1 alias xop .msg x op #php $$1 $2- alias xdop .msg x deop #php $$1 $2- alias xvoice .msg x voice #php $$1 $2- alias xinvite .msg x invite #php $$1 $2- alias xkick .msg x kick #php $$1 $2- alias xban .msg x ban $$chan $$1 $2- alias xunban .msg x unban $$chan $$1 $2- ; X (Undernet) - Utility & Enhanced commands alias register { /msg x@channels.undernet.org login %x_username %x_password //mode $me +x //nick N1ckh3re } alias autojoin echo - | echo Auto-Joining Channels.. | echo - | .timer 1 $calc(%connection_speed + 1) .join #php | .timer 1 $calc(%connection_speed + 1) /join -n #phpjobs ; Utility functions alias ping .ctcp $$1 ping alias cycle .hop $$1 Cycling the channel alias add { ; This alias creates either a new autovoice or autojoin if ($$1 == autovoice) { set $+(%,autovoice.,$$2) 1 | .xvoice $$2 } else if ($$1 == autojoin) { set %channel_autojoin_count $calc(%channel_autojoin_count + 1) | set $+(%,autojoin.,%channel_autojoin_count) $$2 } } ; Shorthand Aliases (X, Undernet) alias x /xaccess $$1 alias o /xop $1 $2- alias d /xdeop $1 $2- alias v /xvoice $1 $2- alias b /xban $$1 $2- alias u /xunban $$1 $2- alias k /xkick $$1 $2- ; Shorthand Aliases (Misc) alias aj /autojoin ; EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS - EVENTS ; Initiation event (installer) on *:LOAD:{ .timerInitialize 1 0 .initialize } ; Automatic connect (Undernet) on *:START: if (%initialized == 0) .initialize | .server $eval($+(%,servers.undernet.,%current_server),2) on *:CONNECTFAIL:echo - | .echo $+(Trying next server [,$eval($+(%,servers.undernet.,%current_server),2),..,]) | echo - | if (%current_server < %server_count) set %current_server $calc(%current_server + 1) | else %current_server = 0 | .server $eval($+(%,servers.undernet.,%current_server),2) ; X (Undernet) Automatic Authentication triggers on *:CONNECT:.timerXLogin 1 1 .register | .timerXLogin_delayed 2 $eval($calc(%x_connection_speed * 10),2) .register on *:NOTICE:AUTHENTICATION SUCCESSFUL*:*:.timerXLogin off | .timerXLogin_delayed off | .aj on *:NOTICE:AUTHENTICATION FAILED**:*:.timerXLogin 6 $calc(%x_connection_speed * 5) .register on *:NOTICE:*already authenticated*:*:.timers off | .timers off | .aj