mIRC Home    About    Download    Register    News    Help

Topic Options
#137165 - 09/12/05 12:08 AM simple text script
NeUtRoN_StaR Offline
Fjord artisan

Registered: 06/03/05
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  
  }
}


Top
#137166 - 09/12/05 12:23 AM Re: simple text script
FiberOPtics Offline
Hoopy frood

Registered: 05/02/04
Posts: 2019
Loc: Leuven, Belgium
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.

Top
#137167 - 09/12/05 12:29 AM Re: simple text script
NeUtRoN_StaR Offline
Fjord artisan

Registered: 06/03/05
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


Edited by NeUtRoN_StaR (09/12/05 12:36 AM)

Top
#137168 - 09/12/05 12:39 AM Re: simple text script
NeUtRoN_StaR Offline
Fjord artisan

Registered: 06/03/05
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

Top