|
Joined: Apr 2003
Posts: 57
Babel fish
|
OP
Babel fish
Joined: Apr 2003
Posts: 57 |
often when i am in a channel i see people saying "thank you for voice" when they get voiced. i would like to know what the code for this is.
|
|
|
|
Joined: Mar 2003
Posts: 36
Ameglian cow
|
Ameglian cow
Joined: Mar 2003
Posts: 36 |
this is the code :
press Alt+R and Paste...
on ^1:RAWMODE:#: { if ($1 == +v) && ($2 == $me) { msg $chan thanks for the voice $nick } }
|
|
|
|
Joined: Dec 2002
Posts: 2,809
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,809 |
Thats a rather bad way to do it. What if they typed +mv yournick? Or +vvv somenick somenick yournick?
ON *:VOICE:#:{
if ($vnick == $me && $nick != chanserv) {
.msg $chan Hey $nick thanks for the +v!
}
}
|
|
|
|
Joined: Mar 2003
Posts: 36
Ameglian cow
|
Ameglian cow
Joined: Mar 2003
Posts: 36 |
Ups, you are rigth... your code is much better than my When i thing 1stuff, you thing 6 stuff =P
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
you could always do..
alias parsemodes { /set -u0 %param 2 /set -u0 %m 1 while (%m <= $len($gettok($1, 1, 32))) { /set -u0 %chr $mid($gettok($1, 1, 32), %m, 1) if (%chr isin +-) { /set -u0 %mod %chr } else { if ((%chr isincs $remove($gettok($chanmodes,1-3,44),$chr(44))) || (%chr isincs qaohv)) { /set -u0 %modes $addtok(%modes, $+(%mod,%chr,:,$gettok($1, %param, 32)), 32) /inc -u0 %param } else { /set -u0 %modes $addtok(%modes, $+(%mod,%chr), 32) } } /inc -u0 %m } return %modes }
on 1:RAWMODE:#: { if ($nick != #me) && ($nick != ChanServ) { if ($istok($parsemodes($1-), $+(+v:,$me), 32)) { /msg $chan Thank you for the voice, $nick $+ ! } else if ($istok($parsemodes($1-), $+(+h:,$me), 32)) { /msg $chan Thank you for the halfop, $nick $+ ! } else if ($istok($parsemodes($1-), $+(+o:,$me), 32)) { /msg $chan Thank you for the op, $nick $+ ! } } }
>:D
-KingTomato
|
|
|
|
Joined: Apr 2003
Posts: 210
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 210 |
ON OP, ON VOICE , ON HELP, is cleaner, simpler and nicer. And in your code, /var is more appropriate than set -u0.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
First off that was a joke. Like i would write 20+lines more code, for what 4 (tops) could do. Secondly, they are var and set are personal preference. Sometimes I have variable last for 3 seconds, givimg me time to use them in anopther alias/remote without them staying in the variables list forever.
-KingTomato
|
|
|
|
Joined: Apr 2003
Posts: 210
Fjord artisan
|
Fjord artisan
Joined: Apr 2003
Posts: 210 |
Ok, when you need a variable to last for 3 seconds and be accessed outside the alias /set -uN is appropriate. But in this instance where /set -u0 is used, I think your prefernce should be /var.
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
I think my preference is what i chose to use, and feel comfortable using.
-KingTomato
|
|
|
|
Joined: May 2003
Posts: 2,265
Hoopy frood
|
Hoopy frood
Joined: May 2003
Posts: 2,265 |
which is the same reason you shouldnt criticise my else { HALT }
new username: tidy_trax
|
|
|
|
Joined: Jan 2003
Posts: 3,012
Hoopy frood
|
Hoopy frood
Joined: Jan 2003
Posts: 3,012 |
neg-- my script won't work without /set's or vars--your will work without a useless else
-KingTomato
|
|
|
|
Joined: Dec 2002
Posts: 1,527
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 1,527 |
damn man why are u still arguing over ppls posting comments to your posts that u dont like? all this is just opinions and preferences in scripting ...... hes entitled to his as u are entitled to urs ..... i think he was posting to urs to help u out to show u that u had useless code into yours ..... here your just pluggin the board looking for more attention ..... let it be
D3m0nnet.com
|
|
|
|
Joined: May 2003
Posts: 12
Pikka bird
|
Pikka bird
Joined: May 2003
Posts: 12 |
Where is this code placed
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
In a 'remotes' script file. Press Alt+R to open the remotes editor.
|
|
|
|
Joined: May 2003
Posts: 12
Pikka bird
|
Pikka bird
Joined: May 2003
Posts: 12 |
how can i make this seen on the open channel instead of just the op computer.
|
|
|
|
Joined: Dec 2002
Posts: 699
Fjord artisan
|
Fjord artisan
Joined: Dec 2002
Posts: 699 |
Just remove the dot from in front of msg ON *:VOICE:#:{
if ($vnick == $me && $nick != chanserv) {
msg $chan Hey $nick thanks for the +v!
}
}
|
|
|
|
|