mIRC Home    About    Download    Register    News    Help

Print Thread
#205744 30/10/08 09:07 PM
Joined: May 2008
Posts: 127
J
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2008
Posts: 127
How does event1 trigger and at the same time event2 triggers, and have event1 collect information given from event2?

Code:
ON *:TEXT:!testcmd:#echo: {
  msg #opers !locate
  .timer 1 2 msg $chan I was told the location is: %var
}
ON *:TEXT:Location is*:#opers: { set %var $3- }


I have 2 bots. One is the mIRC bot I'm implementing this system into and the other is a PAWN scripted bot that is in a different channel from my mIRC bot. If someone from #echo types !testcmd, I want the mIRC bot to message a command in #opers which the PAWN bot will pick up on and respond, then I want my mIRC bot to store what the other bot says and return that information given back into #echo. So basically...

Quote:

(#echo) Joe_Dean: !testcmd
(#opers) mIRCbot: !locate
(#opers) PAWNbot: Location is Salt Lake City
(#echo) mIRCbot: I was told the location is: Salt Lake City


I've made many attempts of doing this, from setting a var to writing to a file in the second event, and it all works except at the last part of the script where the mIRCbot reports back to #echo, it returns nothing but the info is stored. It's almost as if the info needed is stored AFTER the mIRCbot reports back to #echo. I tried setting up a timer (as you can see) to prevent this but that doesn't seem to work either.

Tbh I confused myself while posting this and if I confused you, please join my network so I can actually show you (irc.lvrcr.com) and then just PM me (Joe_Dean).

Thanks smile

Last edited by Joe_Dean; 30/10/08 09:13 PM.
Joe_Dean #205746 30/10/08 09:54 PM
Joined: Jan 2007
Posts: 1,156
D
Hoopy frood
Offline
Hoopy frood
D
Joined: Jan 2007
Posts: 1,156
Well there are many ways of doing this. Without testing it I may miss some loophole but here is one way of doing it ...

As usual the solution is much simpler than we try to make it. lol
The issue I see is you left out the text command for pawnbot to see !location. Once this event is put in place it is very simple.

Code:
mIRCbot:

ON *:TEXT:!testcmd:#echo:{ msg #opers !locate }
on *:text:Location is *:#opers:{ msg #echo I was told the location is $3- }

Pawnbot:

on *:text:!locate:#opers:{ msg $chan Location is SLC }



Hope this helps!

DJ_Sol #205757 31/10/08 12:20 AM
Joined: May 2008
Posts: 127
J
Vogon poet
OP Offline
Vogon poet
J
Joined: May 2008
Posts: 127
No, I need it to return back to event1. So start at event1, activate event2, gather information from event2 and return it back to event1.

Last edited by Joe_Dean; 31/10/08 12:21 AM.
Joe_Dean #205758 31/10/08 12:33 AM
Joined: Oct 2003
Posts: 3,918
A
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
You can't return information from/to events. If you could, you wouldn't want to. The way to go about this is to do what DJ_Sol suggested: receive event 1, request and wait for event 2 and continue from event 2. His suggested code works fine. When you receive !testcmd you only send !location-- when you receive Location is* you only msg your response.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"

Link Copied to Clipboard