This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
Sergios
Voice
Posts: 14 Joined: Fri Jul 23, 2004 2:48 pm
Post
by Sergios » Wed Nov 24, 2004 11:41 pm
Is it possible to make a script execute a raw command like /admin every x minuters and the result of this command write automatically to admin.html?? I have try but i get errors with raw command.
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Nov 25, 2004 1:41 am
it is:
Code: Select all
bind raw - * myraw
bind time - "00 % % % %" {set f [open foo.txt w]; putserv admin;#}
proc myraw {f k t} {
if [string match 25\[6-9\] $k] {puts $::f [join [lrange [split $t] 1 e]]}
if {$k == 259} {close $::f}
}
Sergios
Voice
Posts: 14 Joined: Fri Jul 23, 2004 2:48 pm
Post
by Sergios » Thu Nov 25, 2004 1:16 pm
It doesnt write anything into the foo.txt file. It create the file but the file is still empty. Any suggestion??
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Nov 25, 2004 2:21 pm
I thought eggdrop matches raw bind mask with wildcards; turns out that's not the case; from src/mod/server.mod/servmsg.c:
Code: Select all
x = check_tcl_bind(H_raw, code, 0, " $_raw1 $_raw2 $_raw3",
MATCH_EXACT | BIND_STACKABLE | BIND_WANTRET);
so, it's not MATCH_MASK as I thought it would be (and should be, IMO)
so, the solution will become:
Code: Select all
bind raw - 256 myraw
bind raw - 257 myraw
bind raw - 258 myraw
bind raw - 259 myraw
bind time - "00 % % % %" {set f [open foo.txt w]; putserv admin;#}
proc myraw {f k t} {
puts $::f [string trimleft [join [lrange [split $t] 1 e]] :]
if {$k == 259} {close $::f}
}
Sergios
Voice
Posts: 14 Joined: Fri Jul 23, 2004 2:48 pm
Post
by Sergios » Thu Nov 25, 2004 2:46 pm
I add the numerics of binds that you give me (there same as numerics server) but the file is still empty. Any sollution?
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Nov 25, 2004 4:09 pm
it works on my bot
check whether your server's numerics for ADMIN reply are the same, if your server replies to /admin at all, and if there's no lag
demond
Revered One
Posts: 3073 Joined: Sat Jun 12, 2004 9:58 am
Location: San Francisco, CA
Contact:
Post
by demond » Thu Nov 25, 2004 4:18 pm
oh, and in case you haven't noticed - the code I gave you writes to file once every hour, on top of the hour; if you need it to be triggered more frequently, tweak the time bind or use timer
Sergios
Voice
Posts: 14 Joined: Fri Jul 23, 2004 2:48 pm
Post
by Sergios » Thu Nov 25, 2004 4:47 pm
Yes, i see timer, i change it to see if it works. Yes on dalnet it works, but on unrealircd it doesnt work. the numerics on unreal are
#define RPL_ADMINME 256
#define RPL_ADMINLOC1 257
#define RPL_ADMINLOC2 258
#define RPL_ADMINEMAIL 259
The binds that you have.