mIRC Home    About    Download    Register    News    Help

Print Thread
Questions about writing a script #74832 11/03/04 02:04 PM
Joined: Mar 2004
Posts: 8
Z
Zer Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2004
Posts: 8
hi all,I just begin trying to write some scripts but find it much different besides other programming languages.

first,I try to write a script that I can use different name in different servers
on 1:CONNECT: {if ($server == irc.a.net){/nick zer}
}

on 2:CONNECT: {if ($server == irc.b.net){/nick boo}
}
but it show some mistakes.

I was try to write another script that will catch a single persion say something match "aabb" and copy his words to another ircnetwork and in another room.Can someone help me plz.

Re: Questions about writing a script #74833 11/03/04 02:14 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
your problem is spacing:

Code:
on *:connect:{
  if $server == irc.a.net { nick nick1 }
  elseif $server == irc.b.net { nick nick2 }
  elseif $server == irc.c.net { nick nick3 }
}

as for the on text event:
Code:
on *:text:aabb:#channel:{
  var %i 1
  while $scon(%i) {
    scon %i
    if $scon(%i).server == irc.d.net { msg #channel $nick said aabb in # }  
    inc %i
  }
}


New username: hixxy
Re: Questions about writing a script #74834 11/03/04 03:25 PM
Joined: Mar 2004
Posts: 8
Z
Zer Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2004
Posts: 8
thanks,the first cript works fine.
But still have some questions on the second

I connect to 2 server irc.a.net join #a and irc.b.net join #b
when I say aabb in #a,it won't say anything in #b

on *:text:aabb:#a:{
var %i 1
while $scon(%i) {
scon %i
if $scon(%i).server == irc.b.net { msg #b $nick said aabb }
inc %i }
}

actually I want the script shows more,like copy the whole sentences this person said.Will u plz help me?

Re: Questions about writing a script #74835 11/03/04 03:33 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
oh i thought you meant when someone else said aabb, ok here:

Code:
on *:input:#:{
  if $server == irc.a.net && # == #a {
    var %i 1
    while $scon(%i).server {
      if $scon(%i).server == irc.b.net { 
        scon %i
        msg #b $1-
      }
      inc %i
    }
  }
}



New username: hixxy
Re: Questions about writing a script #74836 11/03/04 03:58 PM
Joined: Mar 2004
Posts: 8
Z
Zer Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2004
Posts: 8
hi,thank you for ur fast reply

I just try ur scripts.
I connect www.a.net,join #a and connect to www.b.net,join #b.

when I say something in #a and will mirror one to #b,it works fine.
You thought what I mean is someone else say something,yeah that's actually what I meant.

One person with a stickname test says something in #a that match "abcde" and "12345" will be mirror to #b immediately.

and more,if I copy this script for many times and mirror many ppl in different channl,will it work fine too ?
btw,this script will remove all the space in the head of a sentences.but it's okay 4 me.

Last edited by Zer; 11/03/04 03:59 PM.
Re: Questions about writing a script #74837 11/03/04 04:21 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
Code:
on *:text:*:#channel:{
  if $server == irc.a.net && # == #a {
    var %i 1
    while $scon(%i).server {
      if $scon(%i).server == irc.b.net { 
        if $1- isin abcde 12345 {
          scon %i
          msg #b $nick $1-
        }
      }
      inc %i
    }
  }
}


New username: hixxy
Re: Questions about writing a script #74838 11/03/04 04:53 PM
Joined: Mar 2004
Posts: 8
Z
Zer Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
Z
Joined: Mar 2004
Posts: 8
Thank you very much,you are so kind hearted.
I will use that to caught some badguy say the F words in the channl

Re: Questions about writing a script #74839 11/03/04 04:55 PM
Joined: Nov 2003
Posts: 2,327
T
tidy_trax Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Nov 2003
Posts: 2,327
np smile


New username: hixxy