mIRC Home    About    Download    Register    News    Help

Print Thread
Joined: Nov 2004
Posts: 5
O
OnAir Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Nov 2004
Posts: 5
I've made a script for my bot if somebody type !xxxx on #chan1 the bot copy the !xxxx on #chan2 and than he send the result back to #chan1 (with $gettok).

Now the problem is the bot have to copy 'not only' from #chan1 to #chan2 but also to another server. Because #chan2 has moved to another server. is this possible?

Joined: Sep 2004
Posts: 200
I
Fjord artisan
Offline
Fjord artisan
I
Joined: Sep 2004
Posts: 200
its posseble.. /help sockets

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
Hi,

Code:
on *:TEXT:!xxxxx:#chan1:{
  var %a = #chan2
  if %a ischan { msg %a $1 }
  scon -at1 if [color:red]irc.yourserver.net[/color] == $!server && %a ischan $({ var %b = $cid },0) 
  if %b { scid %b | msg %a $1 }
}

Explanation of the code:

When a person types !xxxxx in #chan1, the script will message #chan2 on the same server, if that is a channel that you are on.

Then I'm trying to find the connection id of the server "irc.yourserver.net" where you are on channel #chan2. If it finds this channel on that particular server, it will change the active connection to that server, and send !xxxxx to that channel as well.

Note, while there's no need for the extra pipe when using scid %b | msg %a $1, I still put it, since if you should ever change this command to relay any text, you could get very unrequired results, because scid will evaluate the copied text first.

Change irc.yourserver.net to the second server.

Greets


Gone.
Joined: Nov 2004
Posts: 5
O
OnAir Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Nov 2004
Posts: 5
@ FiberOPtics

thx you very much it works, woehoe wink

Joined: Nov 2004
Posts: 5
O
OnAir Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Nov 2004
Posts: 5
this code work fine to send it to #chan2 at server2:

on *:TEXT:!xxxxx:#chan1:{
var %a = #chan2
if %a ischan { msg %a $1 }
scon -at1 if irc.yourserver.net == $!server && %a ischan $({ var %b = $cid },0)
if %b { scid %b | msg %a $1 }
}

but the problem i still have, is i can't send the result back to #chan1 at server1. Any suggestions?

example:
- I type
!xxxx blablabla (#chan1 at server1)
- bot1 copy the whole line to #chan2 at server2
than bot2 give a result with keyword [search]
- and now bot1 has to copy that result back to #chan1 at server1 (but that doesn't work for me)

Joined: Feb 2004
Posts: 2,019
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2004
Posts: 2,019
I can't help you to the best of my abilities, if you are not more specific about a number of issues.

* What are the 2 different networks we are dealing with here?
* Do you always connect to those 2 exact servers, or do you use whatever server to get on those specific networks?
* This bot, that you want to relay text from #chan2 back to #chan1, what is its nickname?
* This reply: in what form is it? How can I distinguish it from other text from this bot?
* Is the reply messaged to the channel (#chan2) or noticed to you, or with ctcp, or in a private message?
...

Btw have you read up on the multiserver commands/identifiers? Check out this document and you should even be able to script this yourself smile

Greets


Gone.
Joined: Nov 2004
Posts: 5
O
OnAir Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
O
Joined: Nov 2004
Posts: 5
@ FiberOPtics

The scripts seems to work, I would like to thank you very very very ... much without your help i couldn't make it. I was just forgotten to put a } at the end smirk


Link Copied to Clipboard