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.

How to make a simple command script

Old posts that have not been replied to for several years.
V
Vyrus

Post by Vyrus »

That will notice the whole channel and everyone in it and I'd just like it to notice the person that uses the command and only in that 1 channel out of 3. They use it in.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

Well then use:

Code: Select all

putserv "NOTICE $nick :Your Notice"
To notice the user who triggered the command.
I'd just like it to notice the person that uses the command and only in that 1 channel out of 3. They use it in.
Be clear.
Well the above command will notice the person who uses that command. The notice command is private and has nothing todo with channels.

Then whats the use of saying you want it to notice that user in only that 1 channel out of 3? What is that suppose to mean?

Notices are of two types, either channel notices or private notices.
- A 'channel notice' is sent on the channel so all users in it can veiw it.
- A 'private notice' is sent to the user and has nothing todo with channels.

If you want to use that command on specific channels, meaning you want the command to trigger on specific channels then use:

Code: Select all

#### SETTINGS ###
#Set the channel for this script to work on.
set respondchan "#mychannel"

#Set the text you want to notice the user with.
set respondtext "Hello, how are you?"

### SCRIPT ###
bind pub -|- .commands commands

proc commands {nick uhost hand chan text} {
 global respondchan respondtext
  if {([string equal -nocase $chan $respondchan]) && ($respondtext != "")} {
  putserv "NOTICE $nick :$respondtext"; return 0
  }
} 
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
V
Vyrus

Post by Vyrus »

yea thats what I needed exactly, thanks.
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

:mrgreen: :mrgreen: :mrgreen:
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
V
Vyrus

Post by Vyrus »

Ok well one last problem below in the code:

bind pub -|- .commands commands

proc commands {nick host handle chan text} {
putserv "NOTICE $nick :[ Commands]-[ .news .website .etc ]"
}

When I try to start the bot with brackets in its reply it gives me an error and doesnt run, but when I remove the brackets and just have the message the bot runs and starts fine and works. How do I use brackets in the bots message?


**EDIT** I received help on this already

Solution: Those []'s = inline execution statement (function call, returns the results. If you want to use brackets, use \[ and \]
User avatar
awyeah
Revered One
Posts: 1580
Joined: Mon Apr 26, 2004 2:37 am
Location: Switzerland
Contact:

Post by awyeah »

That stands also for } { " and \ you will need to put an extra \ infront of those as well besides the [ and ] if you encounter them in any script, so the script doesn't choke on special characters.
·­awyeah·

==================================
Facebook: jawad@idsia.ch (Jay Dee)
PS: Guys, I don't accept script helps or requests personally anymore.
==================================
Locked