IceChat Forums

IceChat 7 => IceChat 7 Scripts => Topic started by: trehahn on January 22, 2007, 05:24:17 PM

Title: Changing Original Scripts
Post by: trehahn on January 22, 2007, 05:24:17 PM
What exactly must be changed in a script for our use?  In general of course.  For example, to rejoin on kick.  I understand the reasons I read for not including this option, however I rarely if at all get kicked for a good reason, generally it's just messing around or trying to wake me up etc.  So I tried to get this to work:

Sub ONKICK(Nickname,Host,Channel,WhoKicked,Reason,ServerNumber)
If Nickname = GetIdentifier("$me",ServerNumber) Then
SendCommand "/join "+Channel,ServerNumber
End If
End Sub

What exactly would I change?  I did get it to work with IceChat 5 awhile back, I'm running the latest version now. I also chat on 2 servers at once, in 3 different rooms between the 2 servers if that makes a difference.  It is showing up in the list (scripts and scripts file as kicks.ics) but will not work.  Many of them have the same info, Nickname,Host,Channel, etc.. since I'm new to IceChat and this scripting, it is confusing to me.  I'm sure once I see the answer I'll smack myself and say DUH but at this point I'm lost.  mIRC scripting came natural to me, I've struggled to understand this.  If I get a couple working I will probably start to understand it.  Thanks.
Title: Re: Changing Original Scripts
Post by: Snerf on January 22, 2007, 08:36:54 PM
If you are in IceChat 7, you need to save it as a IceChat 5 script. You use Save As, and then choose the different file type.
The default scripts in ice7 are the mirc style.
Title: Re: Changing Original Scripts
Post by: DarkStar on January 22, 2007, 08:42:44 PM
well there are a few things you did wrong.

1) you saved it as kicks.ics. The VBS style of scripting must be saved as

2. just a *little* error in the syntax of the script:

Sub ONKICK(Nickname,Host,Channel,WhoKicked,Reason,ServerNumber)
If lcase(Nickname)=lcase(mynickname) Then SendCommand "/join " & Channel,ServerNumber
End Sub

if your only using one command, you can include it on one line, with the if ... then.

If you want the script in the mIRC style scripting engine, here it is.

on *:kick:*:if ( $knick == $me ) /join $chan

this wouold be saved as a .ics file

hehe, Snerf beat me.

EDIT: I should make myself clearer on point 2. The problem wasnt with you using end if instead of the way i showed, but you used a "+" instead of a "&" between "/join " and channel.
Title: Re: Changing Original Scripts
Post by: trehahn on January 22, 2007, 11:09:26 PM
I got the code from another reply I was looking at, it was the exact code that was posted on the forum here in Icechat 5 scripting.  I just copied it and pasted it in here, wasn't really my code.  If I lead you to believe that I'm sorry.  I am still an Icechat newb. 

I wasn't aware of the file differences.  When you click on Save or save as if it wasn't saved, it asks to save it as an ics file, I assumed (I should know what happens when one assumes) that it was the standard for Icechat.  See I'm learning!  I really like the layout and way Icechat works over mIRC but I've used mIRC for so many years that I'm used to scripting with it.  Most things by now I would have given up and gone back, but programming has always intrigued me!  I wish we had done more in college, and I had stuck with it.  Should have taken computer science instead LOL  Thanks.
Title: Re: Changing Original Scripts
Post by: DarkStar on January 23, 2007, 05:47:21 PM
You should feel pretty much at hom with the .ics scripting then. Not all features are there, but it is based off of the mIRC scripting engine. The reason it is the default is because it is not available in Icechat5, making it part of Icechat7. The vbs scripting engine is there to give support for the scripts from Icechat5. But, I prefer to use the VBS engine myself, the other is...more confusing. :)