mIRC Homepage
Posted By: Zer Questions about writing a script - 11/03/04 02:04 PM
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.
Posted By: tidy_trax Re: Questions about writing a script - 11/03/04 02:14 PM
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
  }
}
Posted By: Zer Re: Questions about writing a script - 11/03/04 03:25 PM
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?
Posted By: tidy_trax Re: Questions about writing a script - 11/03/04 03:33 PM
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
    }
  }
}

Posted By: Zer Re: Questions about writing a script - 11/03/04 03:58 PM
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.
Posted By: tidy_trax Re: Questions about writing a script - 11/03/04 04:21 PM
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
    }
  }
}
Posted By: Zer Re: Questions about writing a script - 11/03/04 04:53 PM
Thank you very much,you are so kind hearted.
I will use that to caught some badguy say the F words in the channl
Posted By: tidy_trax Re: Questions about writing a script - 11/03/04 04:55 PM
np smile
© mIRC Discussion Forums