mIRC Home    About    Download    Register    News    Help

Print Thread
#2340 18/12/02 12:56 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings,

I need some insight and help to get this command to function properly for us. We need all of the 3 triggers working, currently on the kick trigger is functioning for us.

;The trigger on the raw 317 from the whois issued
raw 317:*: {
if ($3 >= $calc(60 * %kidle)) { kick $active $2 Found a visitor parked and abandoned for more than %kidle Minutes and is now Toad }
elseif ($3 >= $calc(30 * %kidle)) { msg # Shines light on $active $2 you've been parked and idle for %kidle Minutes and might be Toad when I return }
elseif ($3 >= $calc(22 * %kidle)) { msg # Checks tires on $active $2 here's some No Doze(tm) to prevent you being Toad }
}

The only trigger which is working is the first if statement

if ($3 >= $calc(60 * %kidle) { kick etc.etc.

We need the other triggers to warn of inactivity, currently those are being bypassed and the idle visitor is kicked from the channel.

Any thoughts or suggestions would be appreciated,

Thanks,
MDA

#2341 18/12/02 01:10 AM
Joined: Dec 2002
Posts: 144
D
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
I would use "if"s only instead of "elseif" and add a "| return" at the end of the lines.

Dana


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
#2342 18/12/02 01:42 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
The reason that your second two lines are not working is that there is no $chan associated with raw 317 (whois idle time). The only reason your first one works is that you happen to have that channel active. If you had your status window as active when you checked their idle time, it wouldn't kick them. It wouldn't know where to kick them from. If you are only in one channel with them, then you can use $comchan($2,1) where $2 is their nick from the 317. If you only want it to occur on a single specific channel, then hard-code the channel name in wherever $comchan($2,1) is in the code below. The logical format you have is quite correct (If-ElseIf-ElseIf). Also, based on the text of your messages, I took the liberty of switching /say to /me.
Code:

;The trigger on the raw 317 from the whois issued
;
raw 317:*:{
  if (($3 >= $calc(60 * %kidle)) && ($me isop $comchan($2,1))) kick $comchan($2,1) $2 Found a visitor parked and abandoned for more than %kidle minutes, $2 is now Toad.
  elseif ($3 >= $calc(30 * %kidle)) describe $comchan($2,1) shines light on $+($comchan($2,1),; $2,$chr(44)) you've been parked and idle for %kidle Minutes and might be Toad when soon.
  elseif ($3 >= $calc(22 * %kidle)) describe $comchan($2,1) checks tires on $+($comchan($2,1),; $2,$chr(44)) here's some NoDozĀ® to prevent you being Toad.
}


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C
#2343 18/12/02 04:29 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings Dana,

Thanks for your considertion. I tried your suggestion and that also failed to work. I'm thinking its failing to know what channel to post the msg into. Perhaps privmsg chan$ will force this to function.


Regards,
MDA

#2344 18/12/02 04:46 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
Greetings Hammer,

Some of the notation you added is fairly confusing, it appears that you are kicking the script when that criteria is matched. If the criteria which I posted is correct in the first line of a nested routine, then the channel information needed for the kick (1st triggered nested routine) to actually occur shouldn't be missing for the other two triggers. The kick trigger is fully functioning as I previously posted, in order for that to occur, the channel information would be availiable thruout that nested routine. The raw feed is only ran once per each who/is posting. I'll post the full routine when I get this to function correctly for me.

I do agree however that I don't have the msg command correct regarding the channel information. I'll try various combinations of /msg chan$ privmsg chan$ /msg # and see what functions. Those triggers are likely trying to function however my posting of the message format is not correct and its failing to output the messages contained in the following two triggers into the active channel.

Thanks for your time and consideration,
Regards,
MDA

#2345 18/12/02 05:00 AM
Joined: Dec 2002
Posts: 144
D
Vogon poet
Offline
Vogon poet
D
Joined: Dec 2002
Posts: 144
Yea, Hammer was quite right. smile

Blame it on me only having had 6 hours of sleep in the last 48 hours. Speaking of sleep, I'm going to go and finally catch up on some. wink

Dana


"Any sufficiently advanced technology is indistinguishable from magic." - Arthur C. Clarke
#2346 18/12/02 09:33 AM
Joined: Dec 2002
Posts: 99
M
MDA Offline OP
Babel fish
OP Offline
Babel fish
M
Joined: Dec 2002
Posts: 99
My thanks again to Dana and Hammer, with your suggestions, I was able to get the other two triggers to function properly tonight. They appear stable and fully functional.

#autoidlekick on
on *:START:./timerkid 0 900 /kidle 30
alias kidle {
msg # Lair Troll is checking for sleeping Toads
set %kidle $1
var %l 1
:next
while (%l <= $nick(#,0)) {
if ($nick(#,%l) isop $active) { inc %l | goto next }
else { whois $nick(#,%l) }
inc %l
}
}
;The trigger on the raw 317 from the whois issued
raw 317:*: {
if ($3 >= $calc(60 * %kidle)) { kick $active $2 Found a visitor parked and abandoned for more than %kidle Minutes and is now a Toad }
elseif ($3 >= $calc(30 * %kidle)) { privmsg $active Shines light on $2 you've been parked and idle for %kidle Minutes and might be a Toad when I return }
elseif ($3 >= $calc(22 * %kidle)) { privmsg $active Checks tires on $2 here's some Mt. Dew(tm) to help prevent you being a Toad }
}
#autoidlekick end

Best regards and wishes to each this holiday,
MDA

#2347 18/12/02 10:08 AM
Joined: Dec 2002
Posts: 1,321
H
Hoopy frood
Offline
Hoopy frood
H
Joined: Dec 2002
Posts: 1,321
And again, I remind you that $active might not even be a channel if you lag from the server THEY are on. You might have switched to a query window or your Status window. In such a case, your 317 WILL fail because $active is not a channel, and you definitely are not opped in your Status window. You also have to remember to never user your /kidle alias unless you are opped or it will fail as well. Everything will be fine if you keep the channel you triggered the /kidle alias as the active window until all the whois results are back from the servers. Of course, in a large channel, you will flood yourself off if you don't SendQ off first. You have not taken server<-->server lag into account at all, but presumably you don't care.

$active is not the same thing as $chan (which doesn't matter anyway because 317 does not have a $chan associated with it).

There is no need to use /PRIVMSG when /MSG will do the same thing and allow mIRC to update your $active window properly. /PRIVMSG does not echo your text into that $active, /MSG does. When you want to look for someone's idle time, you have to ask the server they are on; most IRCds that I know of do not propagate idle times across servers, so you have to /WHOIS nick nick As for your loop, here is a much cleaner way:
Code:

  var %i = 1
  ;  Moving to the next non-op (will kick everyone who is not opped if they are idle too long)
  while ($nick(#,%i,a,o)) {
    whois $ifmatch $ifmatch
    inc %i
  }


DALnet: #HelpDesk and #m[color:#FF0000]IR[color:#EEEE00]C

Link Copied to Clipboard