mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Hi smile

Lets say i am in 4 channels that another person is also in. they type @find in all 4 channels at the same time, is there a way to react to the user but only once, not 4 times?

i am thinking $comchan, not sure how i would go about using it though smile any thought or suggestions would be greatly appreciated smile



thanks in advance


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
Set a temp var and check it in the ontext event
Code:
on *:text:@find *:#{
  if %@find. [ $+ [ $nick ] ] { return }
  set -u60 %@find. $+ $nick 1
  ...
}

Joined: Feb 2003
Posts: 1
D
Mostly harmless
Offline
Mostly harmless
D
Joined: Feb 2003
Posts: 1
you might create a timer with something like
Code:
 /timer$nick 1 3 /whatever 
and then just check to see if it's active, thus limiting the person to one search every 3 seconds for all channels you are in

(the code may be bad, but i hope the idea helps)

Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
Hows something like this?
Code:
on *:TEXT:@find*:#:{ 
 if (% $+ $nick $+ .find == $nick) { halt }
  else {
    set -u60 % $+ $nick $+ .find $nick
    other commands and if statements
  }
}


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.
Joined: Dec 2002
Posts: 699
N
Fjord artisan
Offline
Fjord artisan
N
Joined: Dec 2002
Posts: 699
"if (% $+ $nick $+ .find == $nick) { halt }" won't work because it isn't evaluated.
It would need to be "if (% [ $+ [ $nick ] $+ .find ] == $nick)" or "if ($eval($+(%,$nick,.find),2) == $nick)"
Apart from that, this needs less code
Code:
on *:text:@find *:#{
  if %@find. [ $+ [ $nick ] ] { return }
  ; ^ if the variable is set, the script 'returns'
  ; (stops further processing in THIS code block)
  set -u60 %@find. $+ $nick 1
  ; ^ if the variable is set, the script never gets to this line (or any following)

  ;rest of code goes here

}


Last edited by Nimue; 25/02/03 04:38 AM.
Joined: Dec 2002
Posts: 204
K
keeker Offline OP
Fjord artisan
OP Offline
Fjord artisan
K
Joined: Dec 2002
Posts: 204
This is the whole code i have, i hopefully implemented the suggestions you gave me...i am hoping this will cut down on my sending unneeded messages as i am constantly getting the target change too fast. please wait message from the server, even when i do cut down on the channels i am in smile

Code:
on *:TEXT:@find *:#:{
  if (% [ $+ [ $nick ] $+ .find ] == $nick) { return }
  set -u60 % $+ $nick $+ .find $nick
  var %lsearch $+(*,$replace($2-,$chr(32),$chr(42)),*) 
  var %found $hfind(filelist,* $+ %lsearch $+ *,0,w).data
  if (%found != 0) {
    if (%found >= 5) { var %hfound 5 }
    else var %hfound $hfind(filelist,* $+ %lsearch $+ *,0,w).data
    var %tfound %hfound
    .notice $nick 0,2Am Sending You The Results Of Your Query For: %lsearch
    while %hfound > 0 {    
      .timerfind $+ $nick $+ . $+ %hfound 1 $calc(%hfound * 3) .notice $nick ! $+ $me $&
      $nopath($hget(filelist,$hfind(filelist,* $+ %lsearch $+ *,%hfound,w).data))
      dec %hfound 
    }
    .timerfind $+ $nick $+ . $+ final 1 $calc(%tfound * 3 + 3) .notice $nick 0,2 $iif(%found < 5,I have finished $&
      Sending You %tfound results from your search for: %lsearch,I have more than 5 results for %lsearch  please be $&
      more specific or try grabbing my list:  $+(@,$me))
  }
  else .notice $nick 0,2Sorry $nick, i dont have any files matching %lsearch
}

Please Note: This code is wrapped to fit the forum window smile


keek: Scots - intr.v. keeked, keek·ing, keeks
To peek; peep.

Link Copied to Clipboard