mIRC Home    About    Download    Register    News    Help

Topic Options
#263538 - 16/08/18 01:19 AM Colortext in on Text Event
Kaleah Offline
Nutrimatic drinks dispenser

Registered: 16/08/18
Posts: 6
I have the following problem:

I want my bot to respond to the following colored text and then execute a command ...

it is for my own network of Friends
here is the Code:

Code:
on *:text:* $+ $(*4has entered the battle!*):#: {
  set %enemy $1
  /os client join %enemy #battledome
}



so my Problem is the bot dont react of a collored text.. frown


for example: if the gamebot says: Bee has entered the battle!


the Other bot should start the command…

But it dont work smirk

Can Anybody help?

Top
#263539 - 16/08/18 03:40 AM Re: Colortext in on Text Event [Re: Kaleah]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1146
Unless there's a need to differentiate between different messages having different color codes, just do a text match for the text within:

Code:
on *:TEXT:* has entered the battle!*:#:{
  set %enemy $1
  /os client join %enemy #battledome
}


Unless the /os alias contains code to verify that the text is being done by the correct gamebot, you should have code at the beginning of your event handler to make sure it's not me sending that message smile

Something like:
Code:
if ($nick != NameOfGameBot) return

Top
#263540 - 16/08/18 09:22 AM Re: Colortext in on Text Event [Re: maroon]
Kaleah Offline
Nutrimatic drinks dispenser

Registered: 16/08/18
Posts: 6
Originally Posted By: maroon
Unless there's a need to differentiate between different messages having different color codes, just do a text match for the text within:

Code:
on *:TEXT:* has entered the battle!*:#:{
  set %enemy $1
  /os client join %enemy #battledome
}


Unless the /os alias contains code to verify that the text is being done by the correct gamebot, you should have code at the beginning of your event handler to make sure it's not me sending that message smile

Something like:
Code:
if ($nick != NameOfGameBot) return




Can you give me the exact textmatch for it the names are not the same the text with the Name bee was an example

but it can be another Name

To understand the matter better I try to explain it again ....

The Gamebot reads the names from a folder these names are databases where different things are in there ... but that's not important ..

It should be noted that it is not always the same name but the formatting of the text remains see first post.

So if the Gamebot writes now eg: Dirt_Eater has entered the battle!

You see it's a different name than Bee.

Then another Bot should join the bot client of Botserv using the command /os client join %enemy #battledome

into the room we get the variable %enemy with set %enemy $1 law.

Can you now understand what I want to achieve?


sry for bad english


Edited by Kaleah (16/08/18 09:39 AM)

Top
#263541 - 16/08/18 09:39 AM Re: Colortext in on Text Event [Re: Kaleah]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3506
Loc: France
Code:
on *:TEXT:*:#:{
 if (* has entered the battle!* iswm $strip($1-)) {
  set %enemy $1
  /os client join %enemy #battledome
 }
}
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#263542 - 16/08/18 09:47 AM Re: Colortext in on Text Event [Re: Wims]
Kaleah Offline
Nutrimatic drinks dispenser

Registered: 16/08/18
Posts: 6
thx wims but the bot sets the wrong variable

%enemy Bee


so the other bot cannot run the command while the var has a colored content

Top
#263543 - 16/08/18 09:50 AM Re: Colortext in on Text Event [Re: Kaleah]
Wims Offline
Planetary brain

Registered: 31/07/06
Posts: 3506
Loc: France
you can use $strip like I did
Code:
set %enemy $strip($1)
_________________________
Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net

Top
#263544 - 16/08/18 09:51 AM Re: Colortext in on Text Event [Re: Kaleah]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1146
I was not talking about the "Bee" or "Dirt_Eather" of either of your examples. The way you presented your code, it would be taking action without making sure the message was by "GameBot" or whatever was the name of your gamebot.

If your script replies to "has entered the battle" spoken by anyone, you could find your script is replying to someone else who is not the gamebot. So that was what my example was trying to do.

Top
#263545 - 16/08/18 09:55 AM Re: Colortext in on Text Event [Re: Wims]
Kaleah Offline
Nutrimatic drinks dispenser

Registered: 16/08/18
Posts: 6
i test it but the variable is %enemy is empty

frown

so
Quote:
set %enemy $Strip($1)
dont work

Top
#263546 - 16/08/18 09:59 AM Re: Colortext in on Text Event [Re: maroon]
Kaleah Offline
Nutrimatic drinks dispenser

Registered: 16/08/18
Posts: 6
Originally Posted By: maroon
I was not talking about the "Bee" or "Dirt_Eather" of either of your examples. The way you presented your code, it would be taking action without making sure the message was by "GameBot" or whatever was the name of your gamebot.

If your script replies to "has entered the battle" spoken by anyone, you could find your script is replying to someone else who is not the gamebot. So that was what my example was trying to do.



So is the main script now correct?

Code:

on *:TEXT:*:#:{
  if ($nick != Battledome) return
  if (* has entered the battle!* iswm $strip($1-)) {
    set %enemy $stip($1) <--- Dont work variable is empty
    /os client join %enemy #battledome
  }
}


Edited by Kaleah (16/08/18 10:00 AM)

Top
#263547 - 16/08/18 10:10 AM Re: Colortext in on Text Event [Re: Kaleah]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1146
Your example mis-spells $strip($1) as $stip($1)

Top
#263548 - 16/08/18 10:11 AM Re: Colortext in on Text Event [Re: maroon]
Kaleah Offline
Nutrimatic drinks dispenser

Registered: 16/08/18
Posts: 6
no it takes the same effect

the variable is empty when i use set %enemy $strip($1)
in my Code


//edit - Works reason:

Oh sorry I did not know that one must pay attention to upper and lower case ..


Thanks vor Quickhelp tread closed



Edited by Kaleah (16/08/18 10:15 AM)

Top
#263549 - 16/08/18 10:32 AM Re: Colortext in on Text Event [Re: Kaleah]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 1146
I'm not sure what you changed to make it work, if spelling strip correctly didn't solve it, because mIRC defaults to matching upper and lower case versions of the same word. It's possible the %enemy just *looks* empty because $1 may have been only a color code. You could make sure $1 is not empty by beginning your event handler with code that changes $1 into a version of the original message without having colors:

tokenize 32 $strip($1-)

Top