Author Topic: In need of autoident  (Read 10514 times)

Osiris

  • Guest
In need of autoident
« on: August 26, 2010, 12:37:02 PM »
I'm trying to migrate from mIRC to icechat, and as I'm an op on a server I have to convert some of my scripts. One of which is an auto ident as nicks are often changed on this server and needing to identify manually after changing back is a real pain in the butt.

How can I convert a script such as this

Code: [Select]
on 1:NOTICE:This nick is owned by someone else.*:?:{
  if $nick = NickServ {
    /msg nickserv ident password
  }
}

And similarly this:
Code: [Select]
on 1:NOTICE:*Access denied*:?:{
  if $nick = ChanServ || $nick = OperServ || $nick = NickServ || $nick = MemoServ  {
    /msg nickserv ident password
  }
}

Thanks much, any advice and help is greatly appreciated!

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: In need of autoident
« Reply #1 on: August 27, 2010, 03:24:46 AM »
Why don't you just use the autoperform option, found in the server editor? You'll want to identify yourself every time you join the server anyway.
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Osiris

  • Guest
Re: In need of autoident
« Reply #2 on: August 27, 2010, 12:26:16 PM »
I do use the auto perform which works great on startup, however it doesn't work after a name change has occurred and I have to ident manually.

Osiris

  • Guest
Re: In need of autoident
« Reply #3 on: August 27, 2010, 04:32:35 PM »
Well I sort of have the audoident going. I've sure people who have a handle on the scripting language will see many flaws with it.

Code: [Select]
Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
if Message = "This nick is owned by someone else.  Please choose another." and Nickname = GetIdentifier ("NickServ") then
sendcommand "/ns identify password"
else if Message = "Access denied." then
sendcommand "/ns identify password"
else if Message = "Permission denied." then
sendcommand "/ns identify password"
end if
end if
end if
End Sub

I still can't figure out how to add multiple names to who could be sending this message, such as with the "Access Denied" message it can come from ChanServ or OperServ.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: In need of autoident
« Reply #4 on: August 27, 2010, 08:41:02 PM »
Ok, you dont need to use GetIdentifier("Nickserv"), as GetIdentifier is used for getting $variables.

Code: [Select]
Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
if Nickname = "NickServ" or NickName = "OperServ" then
    if Message = "This nick is owned by someone else.  Please choose another." then
          sendcommand "/ns identify password", servernumber
    else if Message = "Access denied." then
          sendcommand "/ns identify password", servernumber
    else if Message = "Permission denied." then
          sendcommand "/ns identify password", servernumber
    end if
end if
End Sub

That should do the trick for you.
Its important to add the ServerNumber at the end, if you are connected to multiple servers.
The IceChat God

Osiris

  • Guest
Re: In need of autoident
« Reply #5 on: August 28, 2010, 11:52:51 AM »
Awesome, thanks for the help. I've made the changes to the script which now looks like-
Code: [Select]
Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
if Nickname = "NickServ" or Nickname = "ChanServ" or Nickname = "OperServ" then
    if Message = "This nick is owned by someone else.  Please choose another." then
        sendcommand "/ns identify password"
    else if Message = "Access denied." then
        sendcommand "/ns identify password"
    else if Message = "Permission denied." then
        sendcommand "/ns identify password"
    end if
    end if
    end if
end if
End Sub
As I only connect to one server I didn't include a server number. Also it seemed to want more end ifs so I added those.

Thanks again for the help. 8-)

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: In need of autoident
« Reply #6 on: August 28, 2010, 02:32:48 PM »
Well, it should not need those extra 'end if's, but hey, if it works for you, its all good.
The IceChat God

v29

  • Guest
Re: In need of autoident
« Reply #7 on: February 01, 2011, 04:33:08 PM »
The script seem to work great for me also, but...

if I change my nickname from f.i. "v29" to "v29|Away" it doesn't wanna work.
Well,the nick is added to the profiles and so on.From all of my profiles(v29 or v29|work or v29_ or v29|nap) this one (v29|Away) is the only one which doesn't work properly.

Have to say one thing:I'm a newbie to scripting,so maybe I made some sort of general error while using this script
Code: [Select]
on 1:CONNECT:{
/msg nickserv identify PW
}
Sub ONNOTICEThis nick is owned by someone else.NICK!*@*
if Nickname = "NickServ" or Nickname = "ChanServ" or Nickname = "OperServ" then
if Message = "This nick is owned by someone else.  Please choose another." and Nickname = GetIdentifier ("NickServ") then
sendcommand "/ns identify PW"
else if Message = "Access denied." then
sendcommand "/ns identify PW"
else if Message = "Permission denied." then
sendcommand "/ns identify PW"
end if
end if
end if
end if
End Sub


Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: In need of autoident
« Reply #8 on: February 01, 2011, 05:18:01 PM »
That code wont work at all.

1. You can not mix mirc scripting with VB Style in the same file, they need to be saved in seperate files as seperate file types.

2. Sub ONNOTICEThis nick is owned by someone else.NICK!*@* .. this is all wrong.
it is supposed to be Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
And then you add in all the code, as shown in previous examples.
The IceChat God

v29

  • Guest
Re: In need of autoident
« Reply #9 on: February 02, 2011, 07:19:34 AM »
That code wont work at all.

1. You can not mix mirc scripting with VB Style in the same file, they need to be saved in seperate files as seperate file types.

2. Sub ONNOTICEThis nick is owned by someone else.NICK!*@* .. this is all wrong.
it is supposed to be Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
And then you add in all the code, as shown in previous examples.
thanks.
Did it just like you said (took the mirc stuff out,changed e-thing) and still I have to identify manually when I change my nick.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: In need of autoident
« Reply #10 on: February 02, 2011, 07:31:17 AM »
Paste the what you have. Also, what kind of a file type did you save it as?
The IceChat God

v29

  • Guest
Re: In need of autoident
« Reply #11 on: February 07, 2011, 11:27:01 PM »
Paste the what you have. Also, what kind of a file type did you save it as?
it was a long way till I got what you meant with "save as".also I had no internet access,that's why I'm kinda late on this.sorry.

ok,back to topic:I saved the following as ".ics" in my favorites and atm it looks like it works.
Code: [Select]
ONNOTICE(Message,Nickname,Host,Servernumber)
if Nickname = "NickServ" or "NickName" = "OperServ" then
    if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    else if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    else if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    else if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    else if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    else if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    end if
End if
End NOTICE

since I have 5 different nicks atm, it should be possible to add another one if needed.
it's quite a lot learning by doing.

one more question:do I have to load the script e-time I start Ice or does it load by itself?

thanks much for keeping your great work,snerf.
first I was into mIRC,but then Ice turned out as the better one since it is really more intuitive.

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: In need of autoident
« Reply #12 on: February 07, 2011, 11:38:31 PM »
You should save the file as .ice, not .ics

on the second line, you should not have quotes around Nickname, because that causes it to be treated like a string, not a variable
Code: [Select]
if Nickname = "NickServ" or NickName = "OperServ" then
Also, you have 6 identical If statements. If the first one doesn't trigger, neither will the following 5.

And one more thing, there is no 'Else If', it should be 'ElseIf'
"I don't know what World War 3 will be fought with, but I know World War 4 with be fought with sticks and stones." - Albert Einstein

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: In need of autoident
« Reply #13 on: February 08, 2011, 06:54:22 AM »
Also,you also removed the SUB part in the beginning of the ONNOTICE and at the end it is not END Notice, it is END Sub

Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
.
.
.
End Sub


Also, unless you only connect to 1 server, you should add ', ServerNumber' at the end of the sendcommand lines, so it knows what server to send the command to.

SendCommand "/ns identify PW", ServerNumber
« Last Edit: February 08, 2011, 06:56:48 AM by Snerf »
The IceChat God

v29

  • Guest
Re: In need of autoident
« Reply #14 on: February 09, 2011, 05:58:40 PM »
You should save the file as .ice, not .ics

on the second line, you should not have quotes around Nickname, because that causes it to be treated like a string, not a variable
Code: [Select]
if Nickname = "NickServ" or NickName = "OperServ" then
Also, you have 6 identical If statements. If the first one doesn't trigger, neither will the following 5.

And one more thing, there is no 'Else If', it should be 'ElseIf'
thanks.I'm using 5 nicknames atm and I maybe wanna add one,thats why.weirdly this script works my Vista laptop.(maybe version Ice7 used there?don't have any access to lappie atm,only at weekends)

also,if I save it as ".ice"(win7 PC) there is this error message:
->> ERROR:modScriptFunctions:HF.NOW.working.script4th.try.ice:200:Function:LoadScriptFile:Error Number:1032 : UngültigesZeichen -->(unvalid sign/symbol/parameter - dunno the correct english translation for "Zeichen" at this point),maybe this is because I use Ice7.70?(just clicked on the version info cause this all made no sense to me and invented this...sorry for any confusion btw :))Because when I save it as ics-file,this message doesn't occur.

Quote from: Snerf link=topic=1482.msg6383#msg6383 date=1297176862
Also,you also removed the SUB part in the beginning of the ONNOTICE and at the end it is not END Notice, it is END Sub

Sub ONNOTICE(Message,Nickname,Host,ServerNumber)
.
.
.
End Sub


Also, unless you only connect to 1 server, you should add ', ServerNumber' at the end of the sendcommand lines, so it knows what server to send the command to.

SendCommand "/ns identify PW", ServerNumber
ok,thanks.changed it (took out Servernumber) since I only use one server atm.
But there's still something wrong with it, as I still have to identify manually.

There's something I don't get:is it important to use upper- and lowercases?
Anyway,this my not-working result...phew.This whole thing costs me a lot of patience.

Code: [Select]
Sub ONNOTICE(Message,Nickname,Host)
if Nickname = $NickServ$ or NickName = $OperServ$ then
    if Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    ElseIf Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    ElseIf Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    ElseIf Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    ElseIf Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    ElseIf Message = "This nickname is registered and protected."
        sendcommand "/ns identify PW"
    endIf
EndIf
End Sub

what did I do wrong this time?mixing up the two versions, 7 and 7.70, on 2 different computers?

edit:all my alias list (the default one) is gone, by accident I guess.what do I do now to solve that prob?re-install?
and do all those settings again which I did already,like autoperform by server etc.
o.O way too much for me.I go to sleep

edit2: can someone mail me the aliases by PM please?
« Last Edit: February 09, 2011, 06:04:47 PM by v29 »