global variable to return pub trigger?

Old posts that have not been replied to for several years.
Locked
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

global variable to return pub trigger?

Post by Dedan »

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.
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

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.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

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.
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

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.
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Check the lastbind thing, maybe will help.
Once the game is over, the king and the pawn go back in the same box.
User avatar
user
 
Posts: 1452
Joined: Tue Mar 18, 2003 9:58 pm
Location: Norway

Post by user »

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"?
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

thanks User :D
I once was an intelligent young man, now i am old and i can not remember who i was.
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

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.
User avatar
strikelight
Owner
Posts: 708
Joined: Mon Oct 07, 2002 10:39 am
Contact:

Post by strikelight »

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} {
User avatar
Dedan
Master
Posts: 260
Joined: Wed Jul 09, 2003 10:50 pm
Location: Memphis

Post by Dedan »

ahhhhhhhhhh,
thanks strikelight
I once was an intelligent young man, now i am old and i can not remember who i was.
Locked