alias check { if ($regex(%reg,(ub|op) { set %reg $replace(%reg,ub,-b,op,+o) }
on @:TEXT::#:{ set %cmds invite ban -b +o
if ($regex($1,(i|b|ub|op)) { set %reg $regml(1) $+ \S+ | /check
if ($regex(%cmds,%reg)) && ($regex(%cmds,%reg) !== (-b|+o) { cs $regml(1) # $2 }
else { .mode # $regex(%cmds,%reg) $address($2,2) } }
may confuse you but all in one event and less lines than the other examples
on :TEXT:!:#:{
if ($regex($1,(cricket2011|cwc[0-9])) {
goto $regml(1)
:cricket2011
.msg $nick 4WorLd Cup 2011 CRICKET Match Schedule
.msg $nick 19/2/11 02:30 PM 2India Vs Bangladesh Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 20/2/11 09:30AM 2Kenya Vs New Zealand M.A. Chidambaram Chepauk, Chennai
.msg $nick 20/2/11 02:30PM 3Sri Lanka Vs Canada Hambantota Sooriyawewa, Hambantota District, Southern Provinc
.msg $nick 21/2/11 02:30PM 4Australia Vs Zimbabwe Sardar Patel Stadium Ahmedabad, India
.msg $nick 22/2/11 02:30PM 5England Vs Netherlands Vidarbha Cricket Association Stadium Jamtha, Nagpur
.msg $nick 23/2/11 02:30PM 4Kenya Vs Pakistan Hambantota Sooriyawewa, Hambantota District, Southern Provinc
.msg $nick 24/2/11 2:30PM 6South Africa Vs West Indies Feroz Shah Kotla New Delhi India
.msg $nick 25/2/11 9:00AM 7Bangladesh Vs Ireland Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 25/2/11 2:30PM 10Australia Vs New Zealand Vidarbha Cricket Association Stadium Jamtha, Nagpur
.msg $nick 26/2/11 2:30PM4Sri Lanka Vs Pakistan R Premadasa Stadium Colombo,Srilanka
.msg $nick 0,10 If U Wana See More Match Schedule Then TYPE on Main this -> !Cwc2
.halt
:cwc2
.msg $nick 27/2/11 2:30PM 12India Vs England M Chinnaswamy Stadium Bangalore,India
.msg $nick 28/2/11 9:30AM 13Canada Vs Zimbabwe Vidarbha Cricket Association Stadium Jamtha, Nagpur
.msg $nick 28/2/11 2:30PM 14Netherlands Vs West Indies Feroz Shah Kotla New Delhi India
.msg $nick 1/3/11 2:30PM 2Sri Lanka Vs Kenya R Premadasa Stadium Colombo,Srilanka
.msg $nick 2/3/11 2:30PM 3England Vs Ireland M Chinnaswamy Stadium Bangalore,India
.msg $nick 3/3/11 9:30AM 4Netherlands Vs South Africa Punjab Cricket Association Stadium Mohali,India
.msg $nick 3/3/11 2:30PM4Canada Vs Pakistan R Premadasa Stadium Colombo,Srilanka
.msg $nick 4/3/11 9:30AM 4New Zealand Vs Zimbabwe Sardar Patel Stadium Ahmedabad, India
.msg $nick 0,10 If U Wana See More Match Schedule Then TYPE on Main this -> !Cwc3
.halt
:cwc3
.msg $nick 4/3/11 2:30PM 5Bangladesh Vs West Indies Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 5/3/11 2:30PM 5Sri Lanka Vs Australia R Premadasa Stadium Colombo,Srilanka
.msg $nick 6/3/11 9:30AM 6England Vs South Africa M.A. Chidambaram Chepauk, Chennai
.msg $nick 6/3/11 2:30PM 7India Vs Ireland M Chinnaswamy Stadium Bangalore,India
.msg $nick 7/3/11 2:30PM 10CanadaVs Kenya Feroz Shah Kotla New Delhi India
.msg $nick 8/3/11 2:30PM 4New Zealand Vs Pakistan Pallekele International Cricket Stadium Kandy,Srilanka
.msg $nick 9/3/11 2:30 PM 12India Vs Netherlands Feroz Shah Kotla New Delhi India
.msg $nick 10/3/11 2:30PM 13Sri Lanka Vs Zimbabwe Pallekele International Cricket Stadium Kandy,Srilanka
.msg $nick 0,10 If U Wana See More Match Schedule Then TYPE on Main this -> !Cwc4
.halt
:cwc4
.msg $nick 11/3/11 9:30AM 14Ireland Vs West Indies Punjab Cricket Association Stadium Mohali,India
.msg $nick 11/3/11 2:30PM 2Bangladesh Vs England Zohur Ahmed Chowdhury Stadium Chittagong,Bangladesh
.msg $nick 12/3/11 2:30PM 3India Vs South Africa Vidarbha Cricket Association Stadium Jamtha, Nagpur
.msg $nick 13/3/11 9:30AM 4Canada Vs New Zealand Wankhede Stadium Mumbai,India
.msg $nick 13/3/11 2:30PM 5Australia Vs Kenya M Chinnaswamy Stadium Bangalore,India
.msg $nick 14/3/11 9:00AM 6Bangladesh Vs Netherlands Zohur Ahmed Chowdhury Stadium Chittagong,Bangladesh
.msg $nick 14/3/11 2:30PM4Pakistan Vs Zimbabwe Pallekele International Cricket Stadium Kandy,Srilanka
.msg $nick 15/3/11 2:30PM 7Ireland Vs South Africa M Chinnaswamy Stadium Bangalore,India
.msg $nick 16/3/11 2:30PM 10Australia Vs Canada M Chinnaswamy Stadium Bangalore,India
.msg $nick 17/3/11 02:30PM12 England Vs West Indies M.A. Chidambaram Chepauk, Chennai
.msg $nick 0,10 If U Wana See More Match Schedule Then TYPE on Main this -> !Cwc5
.halt
:cwc5
.msg $nick 18/3/11 09:30AM13 Ireland Vs Netherlands M Chinnaswamy Stadium Bangalore,India
.msg $nick 18/3/11 02:30PM 14New Zealand Vs Sri Lanka Wankhede Stadium Mumbai,India
.msg $nick 19/3/11 09:30AM 2Bangladesh Vs South Africa Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 19/3/11 02:30PM4Australia Vs Pakistan R Premadasa Stadium Colombo,Srilanka
.msg $nick 20/3/11 09:30AM 3Kenya Vs Zimbabwe M Chinnaswamy Stadium Bangalore,India
.msg $nick 20/3/11 02:30PM 4India Vs West Indies M.A. Chidambaram Chepauk, Chennai
.msg $nick 0,10 If U Wana See More Match Schedule Then TYPE on Main this -> !Cwc6
.halt
:cwc6
.msg $nick 23/3/11 02:30PM q1 3TBC Vs TBC Sardar Patel Stadium Ahmedabad, India
.msg $nick 24/3/11 02:30PM q2 3TBC Vs TBC Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 25/3/11 02:30PM q3 3TBC Vs TBC Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 26/3/11 02:30PM q4 3TBC Vs TBC Shere Bangla National Stadium Mirpur Thana, Dhaka
.msg $nick 0,10 If YOu Wana Watch FinaL ScheduLe Then Type On Main this -> !Final
.halt
:final
.msg $nick 0,1 29/3/11 02:30PM semi1 TBC Vs TBC R Premadasa Stadium Colombo,Srilanka
.msg $nick 0,1 30/3/11 02:30PM semi2 TBC Vs TBC R Premadasa Stadium Colombo,Srilanka
.msg $nick 0,1 2/4/11 02:30PM final TBC Vs TBC Wankhede Stadium Mumbai,India
.msg $nick 11 -----------------
.halt
}
}
simple regex combining all the on texts into one plus adding a goto command instaed of lots of if-then-elses and later i may consider doing a socket version to collect active data instead of static.
halt commands stop flooding or errors in the goto command
in future use /notice as it doesn't block up a pm box and posts to the active window instead of the user manually trying to find the pm box.
overall your script is nice just need to practice using regex to reduce the code or even start looking at examples of sockets and practicing using them in conjuction with regex to get the most simple but efficient code whilst still getting active full data.
hmm
this script seens slighty too long couldn't it be made smallerlike this:
alias idle { set %idle 900
var %nick = $nick(%chan,0,a,oh)
while (%nick) {
if ( $nick(%chan,%nick,a,oh).idle != $me ) {
if ( $nick(%chan,%nick,a,oh).idle > %i.limit ) {
ban -ku180 # $nick idle time exceeded!!!
unset %nick
unset %idle }
}
}
}
PunkTuReD is correct $2- would be better it'd save unnecessary processing of useless scripting.
PunkTuReD very good oh and Aucun50 to your previous comment of
"This script you have is a fail! Lol if you type anything it does "You're not oped on #pruserv"
@Linuxuser Check to see before you post, also make the script work right"
well on the server i use it works fine and i use the same format in all my scripts so maybe you just typed it wrong or copy and pasted it wrong.
this script was terribly wrong it's needs a rewrite i can write something twice as good in five minutes btw it only needs one event not 13 seperate ones like this, also don't send messages to the channel as it will anoy other users and finally use # not $chan its quicker to process same as "raw -q kick # $nick" instead of "kick # $nick"
"on :JOIN:#:{ msg $nick For bot commands type !commands
}
on :TEXT:*:#:{ if (!commands isin $1-) { msg $nick Regular commands for this bot are: !commands, !site, !info, !time, and !pm. For op commands, say !opc }
elseif (!site isin $1-) { msg $nick www.bluepower10.webs.com }
elseif (!info isin $1-) { msg $nick This code was made by Bluepower10. Bluepower10 Productions owns this script at http://bluepower10.webs.com }
elseif (!time isin $1-) { msg $nick The global time is $time and the current date is $date }
elseif (!pm isin $1-) { query $nick Hello $nick ! You asked me to PM you, so here I am. What did you want? }
elseif ($nick !isop #) { msg $nick You're not oped on # }
elseif (!ban isin $1-) { mode # +b $2 }
elseif (!unban isin $1- { mode # -b $2 }
elseif (!+i isin $1-) { mode # +i }
elseif (!-i isin $1-) { mode # -i }
elseif (!+m isin $1-) { mode # +m }
elseif (!+m isin $1-) { mode # -m }
elseif (!kick isin $1-) { raw -q kick # $2 you were kicked upon request of $nick }
elseif (!opc isin $1-) { msg $nick Op commands for this bot are: !ban < nickname here >, !unban < nickname here >, !kick < nickname here >, !+m, !im, !+i, !-i, and !topic. Note: These commands only work for ops and if the bot is an op. }
elseif (!updates isin $1-) { msg $nick For updates for this bot go to http://www.hawkee.com/snippet/5615/ }"
pls use this as the update, unless you can create better ;)