Author Topic: on droppout script.  (Read 4024 times)

Jakra

  • Newbie
  • *
  • Posts: 2
on droppout script.
« on: March 06, 2006, 03:47:52 AM »
Hi, I'm new to Ice Chat, and have been playing around with some success in the scripting area.

I've come across a problem though, and that is the following:
When my connection drops out, and I reconnect to the server, I want the client to connect me back as I was.
I have a registered nick, but have already set up a script to detect the nickserv asking for a password, and it responds appropriately.
However, if my old user still exists on the server, I get assigned a backup nick till I ghost the old user.
This is fine except that I can't seem to fine out how to get ice chat to respond to "[18:59] ->> Trying alternative nick name". It doesn't appear to work with onnotify, ontext, nor any of the other sub types I could find. I actually tested these by setting up a simple script that put the message to a mesbox when it was triggered, but this line triggered nothing.
I can only assume that a server message counts as something other than a notify or text, but I don't know what it is.

My other idea was to get the client to check the nickname onconnect, if it weren't what it should be, then to ghost the old user, then change nicks to the old name. But again I came across problems, the script editor throws up errors when I have any identifier with a $ in it, such as $me. This makes it rather difficult to check current nickname. The error the console throws up is "Script Engine Error:1032:Invalid character".
I suspect that this could be because I'm using Ice Chat 5 script types in Ice Chat 7. I'm doing this because I can't find any documentation on the new script type, so I'm using the old one. Have the identifiers not been implemented in Ice Chat 7?

If anyone can tell me how I can get Ice Chat to pick up when the nickname is incorrect, and ghost the old user, please let me know.

Thanks.

P.S. Sorry for the huge post :P

Thanks,
--Jakra

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: on droppout script.
« Reply #1 on: March 06, 2006, 06:34:06 AM »
Quote
But again I came across problems, the script editor throws up errors when I have any identifier with a $ in it, such as $me

When using identifiers in scripting you should use the GetIdentifier command, so instead of just $me use GetIdentifier("$me"), this returns your current nickname
"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: on droppout script.
« Reply #2 on: March 06, 2006, 08:20:55 AM »
Seems like the nickname change event got missed from firing any kind of a script event in IceChat 5. Since you are using IceChat 7, I will look into making sure there is an event fired for this.
Then a quick script can be made up for it.

As for documention for the new IceChat 7 scripting, there was some information in the readme.txt file that came when you installed IceChat 7. It is styled after mirc scripting, but it is not yet complete, and wont be a perfect copy of it.
The IceChat God

Jakra

  • Newbie
  • *
  • Posts: 2
Re: on droppout script.
« Reply #3 on: March 07, 2006, 12:38:05 AM »
Sweet, thanks :)

Got it working!

Code: [Select]
Sub ONCONNECT(ServerNumber)
    if right(getidentifier("$server"),11) = "<servername>" then
    if getidentifier("$me") <> "<nickname>" then
        SendCommand "/msg nickserv ghost <nickname> <password>"
        sendcommand "/timer 1 1 5 /nick <nickname>"
end if

<comment> The reason for the "if right(getidentifier("$server"),11) = "<servername>" then" is because the server I connect to has multiple server names in the same domain, and you never know what you're going to get. This checks for the domain.