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.

on/off switch script

Old posts that have not been replied to for several years.
Locked
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

on/off switch script

Post by Moose »

I am trying to make a script that lets you swap text from online to offline in another script

here is what i have so far

bind pub o|o !request-online whatgoeshereonline?
bind pub o|o !request-offline whatgoeshereoffline?

proc whatgoeshereonline? {nick host handle channel arg} {
putserv "NOTICE $nick :The status is online."
}

proc whatgoeshereoffline? {nick host handle channel arg} {
putserv "NOTICE $nick :The status is offline."
}

but i want it to do it from one proc so weather i say its online or offline it is allways in one peice of text

bind pub o|o !request-offline/online online/offline
proc online/offline? {nick host handle channel arg} {
putserv "NOTICE $nick :The status is offline/online (whatever it is.)"
}
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

bind pub o|o * online:offline
proc online:offline {nick host handle channel arg} {
if {[lindex $arg 0] == "!request-online"} {
putserv "NOTICE $nick :The status is online."
} elseif {[lindex $arg 0] == "!request-offline"} {
putserv "NOTICE $nick :The status is offline."
}
}
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

wow nice one thx 8) 8) 8)
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

the script doesent seem to want to work
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

any more ideas
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

Post by Moose »

ah never mind ive corrected the script :)

bind pubm o|o * online:offline

proc online:offline {nick host handle channel arg} {
if {[lindex $arg 0] == "!request-online"} {
puthelp "NOTICE $nick :The status is online."
} elseif {[lindex $arg 0] == "!request-offline"} {
puthelp "NOTICE $nick :The status is offline."
}
}

you cant use wildcards in a pub bind, you have to use pubm
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

you corrected it ? :P
User avatar
GodOfSuicide
Master
Posts: 463
Joined: Mon Jun 17, 2002 8:00 pm
Location: Austria

Post by GodOfSuicide »

moose, even if you are from qnet and are a very active talker, i think you might have noticed that little <EDIT> button ? theres no need to do a new post for every sentence.
User avatar
Moose
Voice
Posts: 37
Joined: Mon Aug 18, 2003 2:54 am
Location: Northamption, UK
Contact:

lol

Post by Moose »

lol ok i never saw that befor lol thx :)

wow the edit button works :D
Locked