egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

What's wrong??

 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help
View previous topic :: View next topic  
Author Message
CyberianIce
Voice


Joined: 28 Dec 2007
Posts: 12

PostPosted: Sat Dec 29, 2007 5:00 am    Post subject: What's wrong?? Reply with quote

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
View user's profile Send private message
rosc2112
Revered One


Joined: 19 Feb 2006
Posts: 1454
Location: Northeast Pennsylvania

PostPosted: Sat Dec 29, 2007 7:29 am    Post subject: Reply with quote

use botisop $chan instead of isop $botnick $chan
Back to top
View user's profile Send private message
metroid
Owner


Joined: 16 Jun 2004
Posts: 771

PostPosted: Sat Dec 29, 2007 8:23 am    Post subject: Reply with quote

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
View user's profile Send private message
CyberianIce
Voice


Joined: 28 Dec 2007
Posts: 12

PostPosted: Sun Dec 30, 2007 6:05 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Scripting Help All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber