|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
How do I go about taking the results shown by a /trace and putting (redirecting) them into a variable?
I registered; you should too.
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
Thanks for your responce. It looks like possibly raw 203 is what I need. How do I put that in a variable?
Last edited by AWEstun; 02/05/08 04:32 PM.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
/help raw events $1- is the replied information. raw 203:*:echo -a $1- Paste that in your remotes and figure which part you need. If you only needed $2 from the reply, you could do this...
raw 203:*: {
set %var $2
}
or if you only needed $3 from the reply, you could do this...
raw 203:*: {
set %var $3
}
or if you wanted to keep all of the information...
raw 203:*: {
set %var $2-
}
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
Thanks.
Last edited by AWEstun; 02/05/08 04:48 PM.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
Most welcome. 
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
I put 'raw 203:*: echo -a $1-' on a line by itself, but it isn't doing anything. What triggers it?
Last edited by AWEstun; 02/05/08 04:52 PM.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
You would have to do a /trace and that will echo the reply. Then you figure out which part of the reply you need and set it to a variable like I showed above.
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
So that 'I put 'raw 203:*: echo -a $1-' in the remotes and I typed /trace name and it showed all of it. Then I changed '$1-' to just '$1', but it still showed the whole trace.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
You're still seeing the original reply because we didn't halt it. If you changed $1- to just $1 then you should see your nick echoed on a line by itself because $1 in a raw reply is always your nick so try this...
raw 203:*: {
echo -a $2
haltdef
}
I can't pick out exactly what you need because I'm not an oper, all I see when I try a trace is this 481 reply... RoCk Permission Denied: Insufficient privileges $1 = RoCk $2 = Permission $3 = Denied: $4 = Insufficient $5 = privileges 
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
I'm still seeing the whole thing when I type /trace name
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
Do you have another raw event in the same script file that could be catching the 203 event?
raw *:
raw 203:
Either of those would prevent another raw 203 from being triggered. Also try typing /raw on
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
The only line in the remote.ini file is
raw 203:*: { echo -a $1 | haltdef }
and raw is on
EDIT: It appears as it isn't even triggering.
Last edited by AWEstun; 02/05/08 05:25 PM.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
Maybe the numeric is different on the server you're on? Try this and see if you can find out the numeric...
/debug @debug
Then do a trace and watch the @debug window and see what the numeric(s) is for the trace reply.
* RoCk heads out to lunch
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
Yep. yep! That is it - server is modified. It's 205 instead of 203! So, now knowing this, how do I go about writing a lil script that executes this when a user joins the channel and I want to save this info to a file?
EDIT: something I noticed is that it still shows the servers above, but only the $4 info I echo'd.
Last edited by AWEstun; 02/05/08 05:57 PM.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
If you don't want to see the raw output of the trace replies, you could make a raw event for each trace numeric and haltdef it. raw 200:*:haltdef raw 201:*:haltdef raw 202:*:haltdef etc. If you want to trace each user that joins the channel, you could do this...
on *:JOIN:#: {
if (($nick == $me) || ($eval($+(%,didtrace.,$nick),2))) return
set -eu60 $+(%,didtrace.,$nick) $true
!trace $nick
}
...and then catch the reply with your raw 205 event and do with it what you want from there. You could replace the # with your channel name(s) if you only want it to work on a certain channel(s). on *:JOIN:#chan1,#chan2,#chan3: {
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
The raw haltdef's worked.
As for:
on *:JOIN:#: { if (($nick == $me) || ($eval($+(%,didtrace.,$nick),2))) return set -eu60 $+(%,didtrace.,$nick) $true !trace $nick }
I dont understand the $eval string on the second line or any of the third line. Can you explain?
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
If someone with the nick JACK joined the channel, it would set a variable named %didtrace.JACK to $true so if JACK joins more than one of your channels, you will still only do one trace on JACK instead of one for each channel. The variable is automatically unset in 60 seconds. You can remove it if you want, it's a flood protection.
on *:JOIN:#: {
if ($nick != $me) !trace $nick
}
|
|
|
|
Joined: May 2008
Posts: 329
Fjord artisan
|
OP
Fjord artisan
Joined: May 2008
Posts: 329 |
It wont work for me. Following is the exact remote.ini file:
;raw 200:*:haltdef ;raw 262:*:haltdef raw 205:*: { %vname = $4 | haltdef }
;on ^*:JOIN:#: { !trace $nick /msg $nick Hello %vname and welcome! Today is $date (dd/mm/yyyy) and the time is $time (CST). } ; this is my original script, but the trace was lagging? and it is showing the previous traced user.
on *:JOIN:#: { if (($nick == $me) || ($eval($+(%,didtrace.,$nick),2))) return set -eu60 $+(%,didtrace.,$nick) $true !trace $nick /msg $nick Hello %vname and welcome! Today is $date (dd/mm/yyyy) and the time is $time (CST). }
It appears that it isn't even getting passed the flood protection, as I'm not even seeing the raw 200 or raw 262, which are servers and trace end.
I registered; you should too.
|
|
|
|
Joined: Dec 2002
Posts: 2,033
Hoopy frood
|
Hoopy frood
Joined: Dec 2002
Posts: 2,033 |
raw 200:*:haltdef
raw 262:*:haltdef
raw 205:*: { set %vname $4 | haltdef }
/*
on ^*:JOIN:#: {
!trace $nick
msg $nick Hello %vname and welcome! Today is $date (dd/mm/yyyy) and the time is $time (CST).
}
*/
; this is my original script, but the trace was lagging? and it is showing the previous traced user.
on *:JOIN:#: {
if (($nick == $me) || ($eval($+(%,didtrace.,$nick),2))) return
set -eu60 $+(%,didtrace.,$nick) $true
!trace $nick
msg $nick Hello %vname and welcome! Today is $date (dd/mm/yyyy) and the time is $time (CST).
}
It's showing the previous traced user because it hasn't yet had time to set %vname to the new name yet before you msg $nick. You could put the message in the raw event...
raw 200:*:haltdef
raw 262:*:haltdef
raw 205:*: {
if ($eval($+(%,didtrace.,$4),2)) msg $4 Hello $4 and welcome! Today is $date (dd/mm/yyyy) and the time is $time (CST).
haltdef
}
on *:JOIN:#: {
if (($nick == $me) || ($eval($+(%,didtrace.,$nick),2))) return
set -eu60 $+(%,didtrace.,$nick) $true
!trace $nick
}
Change the first and second $4 in the raw 205 to be what ever token is the users nick.
|
|
|
|
|