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...
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.