there are many ways to make something like this. here is just one more way..
on @*:JOIN:#: {
inc $+(%,join,#)
if ($($+(%,welcome,#),2) && $($+(%,joinss,#),2)) { msg # 8,1Welcome $nick $+ ! You are viewer 0,1# $+ $($+(%,join,#),2) }
elseif (!$($+(%,joinss,#),2) && $($+(%,welcome,#),2)) { msg # 8,1Welcome $nick $+ ! }
elseif (!$($+(%,welcome,#),2) && $($+(%,joinss,#),2)) { msg # 8,1Welcome $nick $+ ! You are viewer 0,1# $+ $($+(%,join,#),2) }
}
on $*:TEXT:/^\.(welcome|joins|stats)$/iS:#: {
if ($regml(1) = welcome) { msg # Welcoming users on join is now 04 $+($iif($($+(%,welcome,#),2),DIS,EN),ABLED) | $iif($($+(%,welcome,#),2),unset,set) $+(%,welcome,#) on }
elseif ($regml(1) = joins) { msg # Displaying join number on join is now 04 $+($iif($($+(%,joinss,#),2),DIS,EN),ABLED) | $iif($($+(%,joinss,#),2),unset,set) $+(%,joinss,#) on }
elseif ($regml(1) = stats) { msg # 4,1Joins:0,1 $iif($($+(%,joinss,#),2),on,off) 04,1Welcome:0,1 $iif($($+(%,welcome,#),2),on,off) }
}
you can also do it like this as well if all you are doing is a poke.
on $*:text:/^!((about)?poke)?\s?(\S+)/iS:#:{
if (!$hget(poke,$nick)) {
.hinc -mz poke $nick 3
if ($regml(1) == poke && $regml(2) ison #) { describe # pokes $regml(2) }
elseif ($regml(1) == aboutpoke) {
.notice $nick This script was made by Matt.
.notice $nick IRC vHost, Matt@Hiding.My.Identity.From.You.Stalkers
.notice $nick Do not reproduce without my explicit permission.
}
}
}
instead of useing %quizq != $null or %quizq == $null you could do !%quizq an %quizq
also on ur unset of vars you can do unset %quizy %quizn %quizq %voter or beter yet why not name the vars like %vote.quizy %vote.quizn %vote.quizq and %vote.vote then unset them like unset %vote.*
you do have alot of redundancy in the script but good work on ur first script.
or maybe go with a socket for the hell of it
on $*:text:/@fortune$/iS:#: { if (!%fortuneflood) { set -u3 %fortuneflood on | if ($sock(fortune)) .sockclose fortune | .sockopen fortune www.fortunecookiemessage.com 80 | .sockmark fortune # $chr(91) $nick Here Is Your Random Fortune $chr(93) } }
on *:SOCKOPEN:fortune: { sockwrite -nt $sockname GET / HTTP/1.1 | sockwrite -nt $sockname Host: $+(www.fortunecookiemessage.com,$str($crlf,2)) }
on *:SOCKREAD:fortune: {
var %fortune | sockread %fortune
if ($regex(%fortune,/([A-z].+)<\/p>/)) { msg $sock(fortune).mark $regml(1) :Lucky Numbers: $+($r(0,20),$chr(32),$r(10,50),$chr(32),$r(30,70),$chr(32),and,$chr(32),$r(50,99).) | .sockclose fortune }
}
you can make this
elseif (!part == $1) && ($istok(%partnicks,$nick, 32)) { /part $2- }
elseif (!join == $1) && ($istok(%joinnicks,$nick, 32)) { /join $2- }
elseif (!kick == $1) && ($istok(%kicknicks,$nick, 32)) { /kick $2- }
elseif (!mode == $1) && ($istok(%modenicks,$nick, 32)) { /mode $2- }
elseif (!nick == $1) && ($istok(%nicknicks,$nick, 32)) { /nick $2- }
into somthing like this
elseif ($regex($1-,/^!(part|join|kick|mode|nick)\s(.+)/iS) && ($istok(%partnicks,$nick, 32)) { $regml(1) $regml(2) }
just one of the manny ways to make this
on *:input:#: {
if ($left($1,1) != / && !$ctrlenter) {
msg # $+($iif($me isop #,04,$iif($me ishop #,07,$iif($me isvoice #,12))),$1-)
haltdef
}
}
also why did you post this as a snippet when you left it as a comment on someone elses code? you should really wait an make somthing worth posting instead of posting crap over and over. Dont be in such a rush to post something.
lmao @ > p.s. please do not tell me how to improve the script, only comment on how great it is, or if there's an error. thank you.
If you don't want people commenting on how you can do things better, then don't post it here, and if they do comment with a rewrite ignore or delete if it makes you that upset.
Your snippet will be deleted if you break any of the following rules:
Snippet needs to be tested and functional.
Introduction must describe what the snippet does and how it is used.
At least 25% of the code must be written by you.
If you used somebody else's snippet you must include a URL to the original.
You may not post an updated snippet separately, you need to edit your first post.
nice work.. but the regex you used for ur trigger can use some work.
in stead of
on $*:text:/^[.!@]imdb*/Si:#: {
use
on $*:text:/^[.!@](imdb)\s(.+)/Si:#: {
and then change
$replace($2,$chr(32),+)
to this
$replace($regml(2),$chr(32),+)
it's just the way you have ur regex it will trigger on !imdbhmmbblahbblah csi