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 

Retrieve something with !
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 26, 2006 5:02 pm    Post subject: Reply with quote

Code:
bind pubm - * donate

proc donate {nick uhost hand chan arg} {
 if {[string match -nocase *!donate* [string range $arg 0 9]]} {
  puthelp "privmsg $chan :!msg Donate is OFF!"
 }
}

_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Thu Jan 26, 2006 5:53 pm    Post subject: Reply with quote

I tried exactly your script but it didnt work. And no error message appears.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Thu Jan 26, 2006 7:03 pm    Post subject: Reply with quote

Ok, before explaining anything, this triggers on a public message (chan msg not private). You wanted it to check the first 10 letters if they contain the word !donate; this is what this code does, so make sure "!donate" is in the first 10 letters.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Fri Jan 27, 2006 11:31 am    Post subject: Reply with quote

Is it also possible that the bot only reacts when a certain nick types !donate.
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jan 27, 2006 11:50 am    Post subject: Reply with quote

Bind to a certain flag (i.e. if you use n instead of - then the bot will only answer the global owner (who has the +n) flag).
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Fri Jan 27, 2006 12:02 pm    Post subject: Reply with quote

But its not possible to set it with a certain name?
And that the bot considers the first 10 letters is unimportant now. But can the bot considers only the first word?
Back to top
View user's profile Send private message
Sir_Fz
Revered One


Joined: 27 Apr 2003
Posts: 3793
Location: Lebanon

PostPosted: Fri Jan 27, 2006 6:25 pm    Post subject: Reply with quote

Don't you learn anything from what you're given here? What you've got in this thread is more than enough to teach you how to do it yourself. To check if $nick equals a certain nick use:
Code:
if {[string equal -nocase "youenick" $nick]} {
 # got match
}

Good luck.
_________________
Follow me on GitHub

- Opposing

Public Tcl scripts
Back to top
View user's profile Send private message Visit poster's website
darton
Op


Joined: 21 Jan 2006
Posts: 155

PostPosted: Sat Jan 28, 2006 9:55 am    Post subject: Reply with quote

It is working now.
Thank you very much for your help Sir_Fz.
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 -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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