| View previous topic :: View next topic |
| Author |
Message |
CyberianIce Voice
Joined: 28 Dec 2007 Posts: 12
|
Posted: Sat Dec 29, 2007 5:00 am Post subject: What's wrong?? |
|
|
What's wrong with this code???
| Code: |
proc joincounter {nick host hand chan} {
global jhits
global botnick
set temp 0
set rchan [string tolower $chan]
if {[file exists ./scripts/$rchan.jcount.txt]} {
set o_fid [open "./scripts/$rchan.jcount.txt" "RDONLY"]
gets $o_fid temp
close $o_fid
} else {
set o_fid [open "./scripts/$rchan.jcount.txt" "CREAT RDWR"]
puts $o_fid temp
close $o_fid
}
set jhits $temp
incr jhits
putserv "NOTICE $nick : MESSAGE 1"
putserv "NOTICE $nick : MESSAGE 2"
if {[isop $botnick $chan] && [isop $nick $chan]} {
putserv "NOTICE $nick :MESSAGE 3"
}
set o_id [open "./scripts/$rchan.jcount.txt" "WRONLY"]
puts $o_id $jhits
close $o_id
}
|
No errors, MESSAGE 1 (welcome and count) is ok, MESSAGE 2 (contain descriptions for bots !commands) is fine too, but MESSAGE 3 (wich shold be shown to @ users when the bot is also @, contain description how to use !op commands) does not work... |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sat Dec 29, 2007 7:29 am Post subject: |
|
|
| use botisop $chan instead of isop $botnick $chan |
|
| Back to top |
|
 |
metroid Owner
Joined: 16 Jun 2004 Posts: 771
|
Posted: Sat Dec 29, 2007 8:23 am Post subject: |
|
|
That's because you're testing if the user is opped when the eggdrop only sees the join.
The user is probably not even opped yet.
Also you may want to fix the bug in your code regarding it having to create a new file since it'll create a file with the contents "temp" which can't be incremented. |
|
| Back to top |
|
 |
CyberianIce Voice
Joined: 28 Dec 2007 Posts: 12
|
Posted: Sun Dec 30, 2007 6:05 pm Post subject: |
|
|
You are in right! I forgot to write beggining of the code:
| Code: |
bind join -|- joincounter
|
.....
and users on join does not have @ yet. |
|
| Back to top |
|
 |
|