mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
Ok, i have set up a trivia bot and i put some on text events in my remotes to have it so users can see how to do different things with the bots. The script that I am using for the on text is:

Code:
on 1:TEXT:!commands*:*:/msg $nick 4Available commands for regular users are !hint, !vowels, !words, !repeat, !hof, !hoffast, !hofstreak, !hofwpm, and !records. 1For more information on any of these, type !Command help [command] 4For example, !command help hint
on 1:TEXT:!command help hof*:*:/msg $nick 4The !hof command will show the Hall Of Fame
on 1:TEXT:!command help hint*:*:/msg $nick 4The !hint command will give you some hints about the answer to the question. If it doesn't work, a hint was probably just given. There is a timer set to limit the amount given
on 1:TEXT:!command help hoffast*:*:/msg $nick 4The !hoffast command will give the Hall Of Fame for the fastest time
on 1:TEXT:!command help hofstreak*:*:/msg $nick 4The !hofstreak command will give the Hall Of Fame for the biggest streak of getting the answer correct first
on 1:TEXT:!command help hofwpm*:*:/msg $nick 4The !hofwpm command will give the Hall Of Fame for highest WPM (Words Per Minute = typing rate)
on 1:TEXT:!command help records*:*:/msg $nick 4The !records command will give the Records for Record Streak, Record Time, and Record WPM
on 1:TEXT:!command help vowels*:*:/msg $nick 4The !vowels command will display either some or all of the vowels in the answer
on 1:TEXT:!command help words*:*:/msg $nick 4The !words command will tell you how many words are in the answer
on 1:TEXT:!command help repeat*:*:/msg $nick 4The !repeat command will repeat the question to you


The problem that i am having is that users who use colored text who type any of the !commands dont get a message. I dont know why.....which is why i am asking for help, obviously. I dont think that the problem is the color in my responses.....unless i am utterly oblivious to some rules....ALL HELP IS APPREACIATED AND THANKS IN ADVANCE!

Joined: Jan 2004
Posts: 509
L
Fjord artisan
Offline
Fjord artisan
L
Joined: Jan 2004
Posts: 509
...

The problem is right here.

on 1:TEXT:!commands

Note that !commands isn't in color, so, of course, a square with a number before it does not match.

The field supports wildcards, so you can use...

on 1:TEXT:*!commands

The * is a wildcard.

But, if there was a disadvantage to that, a user could do.

Word1 !commands

And that would trigger also.

But that may be okay with you, for as long as the colors works.

-Neal.

Joined: Jul 2007
Posts: 34
D
Ameglian cow
OP Offline
Ameglian cow
D
Joined: Jul 2007
Posts: 34
Is there ANY other way to do this? I really don't want it to activate whenever someone types !commands. If there isnt, that is fine as few people type it randomly anyways, but it would be nice to cut back on all of the messages. THANKS AGAIN!

Joined: Oct 2004
Posts: 8,330
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
Just do this:

Code:
on *:TEXT:*!command*:*:
  tokenize 32 $strip($1-)
  if ($1- == !commands) { msg $nick 4Available commands for regular users are !hint, !vowels, !words, !repeat, !hof, !hoffast, !hofstreak, !hofwpm, and !records. 1For more information on any of these, type !Command help [command] 4For example, !command help hint }
  elseif ($1-2 == !command help) {
    if ($3 == hof) { msg $nick 4The !hof command will show the Hall Of Fame }
    elseif ($3 == hint) { msg $nick 4The !hint command will give you some hints about the answer to the question. If it doesn't work, a hint was probably just given. There is a timer set to limit the amount given }
    elseif ($3 == hoffast) { msg $nick 4The !hoffast command will give the Hall Of Fame for the fastest time }
    elseif ($3 == hofstreak) { msg $nick 4The !hofstreak command will give the Hall Of Fame for the biggest streak of getting the answer correct first }
    elseif ($3 == hofwpm) { msg $nick 4The !hofwpm command will give the Hall Of Fame for highest WPM (Words Per Minute = typing rate) }
    elseif ($3 == records) { msg $nick 4The !records command will give the Records for Record Streak, Record Time, and Record WPM }
    elseif ($3 == vowels) { msg $nick 4The !vowels command will display either some or all of the vowels in the answer }
    elseif ($3 == words) { msg $nick 4The !words command will tell you how many words are in the answer }
    elseif ($3 == repeat) { msg $nick 4The !repeat command will repeat the question to you }
  }
}


Invision Support
#Invision on irc.irchighway.net

Link Copied to Clipboard