mIRC Home    About    Download    Register    News    Help

Print Thread
simple text script #137165 09/12/05 12:08 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
ok,
i took a request to write a script and i dont know why its giving me so much trouble but it is

the idea is that someone says brb and the script replies hurry back $nick
and the next thing they say triggers a welcome back $nick

the way i approached this; well one of them
was to have
Code:
on @*:text:*:#:{
  if ((% $+ $nick != on) && (*brb* iswm $$1-)) {
    set -s % $+ $nick on
    msg $chan Hurry back $nick
  }
  elseif (% $+ $nick == on) {
    msg $chan Welcome back $nick
    unset -s % $+ $nick  
  }
}


Re: simple text script #137166 09/12/05 12:23 AM
Joined: Feb 2004
Posts: 2,019
FiberOPtics Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Try the following line of code, and see what exactly goes different than what you expect it to do.

//set -s % $+ $me on | echo -a % $+ $me

It will have echo'd: %<yournick>.

Since you want to check the value of %<yournick>, this isn't correct, which leads to the solution of your problem:

//echo -a $(% $+ $me,2)
//echo -a $($+(%,$me),2)
//echo -a % [ $+ [ $me ] ]

Try to figure out why exactly you need to do the three above solutions, typing /help $eval and /help [ ] evaluation brackets, will help you understand.


Gone.
Re: simple text script #137167 09/12/05 12:29 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
i think i tried using forced evaluation with $()
around any instance of % $+ $nick
i dont recall it working but ill take another crack at it
thanks fiber
edit duh need to evaluate it twice
thanks again

Last edited by NeUtRoN_StaR; 09/12/05 12:36 AM.
Re: simple text script #137168 09/12/05 12:39 AM
Joined: Mar 2005
Posts: 212
N
NeUtRoN_StaR Offline OP
Fjord artisan
OP Offline
Fjord artisan
N
Joined: Mar 2005
Posts: 212
k it works now again
i like how u put the teaching angle on it rather than just feeding me the code

thanks once again