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.
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Mon Nov 03, 2003 10:22 am
what global variable will return the word that triggered the proc?
eg. aaa bbb ccc
I need to use pub instead of pubm
Is this possible?
bind pub -|- aaa pri:trigger
bind pub -|- bbb pri:trigger
bind pub -|- ccc pri:trigger
proc pri:trigger {stuff} {
}
I once was an intelligent young man, now i am old and i can not remember who i was.
De Kus
Revered One
Posts: 1361 Joined: Sun Dec 15, 2002 11:41 am
Location: Germany
Post
by De Kus » Mon Nov 03, 2003 10:29 am
I dont know any, but you could make something like
bind pub -|- aaa pri:trigger:aaa
bind pub -|- bbb pri:trigger:bbb
bind pub -|- ccc pri:trigger:ccc
proc pri:trigger:aaa {stuff} {
pri:tigger $stuff aaa
}
proc pri:trigger:bbb {stuff} {
pri:tigger $stuff bbb
}
proc pri:trigger:ccc {stuff} {
pri:tigger $stuff ccc
}
proc pri:trigger {stuff xxx} {
}
no nice code, but you will need only 1 main proc and you will be able to check $xxx to see from where it was called.
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Mon Nov 03, 2003 10:45 am
that's the problem,
i am trying to cut the code down.
as is i have like 15 procs all steaming from
the channel text trigger.
I once was an intelligent young man, now i am old and i can not remember who i was.
Sir_Fz
Revered One
Posts: 3794 Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:
Post
by Sir_Fz » Mon Nov 03, 2003 11:30 am
why won't you use pubm ? use pubm and length to check if = 3 letter, then you won't use more than 1 proc or 2.
caesar
Mint Rubber
Posts: 3778 Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory
Post
by caesar » Mon Nov 03, 2003 12:34 pm
Check the lastbind thing, maybe will help.
Once the game is over, the king and the pawn go back in the same box.
user
Posts: 1452 Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway
Post
by user » Tue Nov 04, 2003 10:35 am
Check the global variable 'lastbind', like caesar said or, if you want some other additional argument passed along from the bind, pass a list of command +argument(s) to 'bind' like this:
Code: Select all
bind pub -|- aaa [list pri:trigger aaa]
Now pri:trigger will be called with 6 arguments; the string "aaa" + the default ones (nick, uhost, hand, chan and arg)
Have you ever read "The Manual"?
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Sat Nov 08, 2003 8:26 pm
thanks User
I once was an intelligent young man, now i am old and i can not remember who i was.
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Sat Nov 08, 2003 8:32 pm
ok, this is the correct structure?
bind pub -|- aaa [list pri:trigger aaa]
proc pri:trigger {nick uhost handle channel text trigger} {
# $trigger == aaa ???
}
I once was an intelligent young man, now i am old and i can not remember who i was.
strikelight
Owner
Posts: 708 Joined: Mon Oct 07, 2002 10:39 am
Contact:
Post
by strikelight » Sat Nov 08, 2003 8:51 pm
Dedan wrote: ok, this is the correct structure?
bind pub -|- aaa [list pri:trigger aaa]
proc pri:trigger {nick uhost handle channel text trigger} {
# $trigger == aaa ???
}
no.. as user said, it is aaa + the regular arguments...
so... more explicit:
Code: Select all
proc pri:trigger {trigger nick uhost hand chan text} {
Dedan
Master
Posts: 260 Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis
Post
by Dedan » Sat Nov 08, 2003 8:58 pm
ahhhhhhhhhh,
thanks strikelight
I once was an intelligent young man, now i am old and i can not remember who i was.