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.
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Fri Oct 24, 2003 4:56 am
I need a script, that will have a public command like this :
!greet ( Here the text )
When i use this command the bot will make a greet text, that will greet al people who join the chan in notice.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Fri Oct 24, 2003 9:40 am
Code: Select all
bind pub m|m !greet greet:msg
bind join - * greet:user
proc greet:msg {nick uhost hand chan arg} {
global greetmsg
set greetmsg "[split $arg]"
}
proc greet:user {nick uhost hand chan} {
global greetmsg
puthelp "NOTICE $nick :$greetmsg"
}
this will let you be able to set the greet message using
!greet <greetmsg> which will be sent to every user who joins.
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Sat Oct 25, 2003 2:27 am
Thx a lot, but can u say me from where did u learn so much? And if exist a manuals in other languages ?
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Sat Oct 25, 2003 3:29 am
It seems to be a problem, when i user !greet <greet msg> the script put a greet on all channels, i wana be set on the specific channel where i use the public command.
THX again ...
Ofloo
Owner
Posts: 953 Joined: Tue May 13, 2003 1:37 am
Location: Belguim
Contact:
Post
by Ofloo » Sat Oct 25, 2003 7:32 am
you mean like show on only one channel or that it is only executable on one channel i mean so you can use the trigger on one chan ?
XplaiN but think of me as stupid
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Sat Oct 25, 2003 8:58 am
if you want it to be displayed on only 1 channel, then add
Code: Select all
foreach channel [channels] {
if {[string match -nocase "#yourchannel" $channel]} {
puthelp "NOTICE.....
}
}
into the greet:user proc
if you want to be able to set a different greet message for each channel and make it greet each message for each channel, then it would need more work.. try to find out yourself.
duofruo wrote: Thx a lot, but can u say me from where did u learn so much? And if exist a manuals in other languages ?
I mostly learn from this forum.. and by looking at other scripts, and sometimes manuals.
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Sat Oct 25, 2003 12:09 pm
No, i mean that i would like to set greets in diferent channel. I want to set in diferent channels, diferent script
.
ie : #chan1 : !greet bla
#chan2 : !greet bla bla
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sat Oct 25, 2003 1:59 pm
Then either use arrays or save to a file.
Once the game is over, the king and the pawn go back in the same box.
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Sat Oct 25, 2003 2:55 pm
As i said i am new in tcl world, i only know bind , putserv if . bla bla.
I don`t know what that is
.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Oct 26, 2003 2:25 am
Once the game is over, the king and the pawn go back in the same box.
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Sun Oct 26, 2003 2:59 am
Caesar thanx. I get the ideea
. Of course it take more then 2 hours but i
succesfully made the script...
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Oct 26, 2003 3:09 am
Oh realy, proove it!
Once the game is over, the king and the pawn go back in the same box.
GodOfSuicide
Master
Posts: 463 Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria
Post
by GodOfSuicide » Sun Oct 26, 2003 3:16 am
duofruo wrote: Caesar thanx. I get the ideea
. Of course it take more then 2 hours but i
succesfully made the script...
are you sure you didnt just wait 2h for user to show up ?
duofruo
Halfop
Posts: 94 Joined: Thu Oct 23, 2003 3:17 pm
Location: Ploiesti@.ro
Contact:
Post
by duofruo » Sun Oct 26, 2003 3:19 am
Nope, i am sure just ask him
I am noy kidding. It was me. But still has some bugs
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Sun Oct 26, 2003 3:52 am
A simple and efficient greet thing based on arrays:
Code: Select all
bind pub m|m !greet greet:msg
bind pub m|m !ungreet ungreet:msg
bind join - * greet:user
proc greet:msg {nick uhost hand chan text} {
global greet
set greet([strlwr $chan]) [split $text]
putserv "NOTICE $nick :Seted greet for $chan to \"[split $text]\""
}
proc ungreet:msg {nick uhost hand chan text} {
global greet
foreach arr_greet [array names greet] {
if {[string match [strlwr $chan] $arr_greet]} {
array unset greet [strlwr $chan]
putserv "NOTICE $nick :Removed greet from $chan channel."
}
}
}
proc greet:user {nick uhost hand chan} {
global greet
if {![info exists greet([strlwr $chan])]} {
return
}
puthelp "NOTICE $nick :$greet([strlwr $chan])"
}
Note that upon restarting or killing the eggdrop he will forget all arrays. So, if you want it to store them then read/write them in a file.
Once the game is over, the king and the pawn go back in the same box.