Author Topic: NOOB Question - How to create a script  (Read 5494 times)

MklKvh

  • Newbie
  • *
  • Posts: 25
NOOB Question - How to create a script
« on: April 23, 2004, 11:15:01 AM »
Please help, I tried the

following things:

1 Open the Script Editor
2 Press New Script
3 Insert "ONTEXT Event" and a "Echo

Command"

   Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
     'Echo "I want to add this

Text","#channel",ServerNumber
   End Sub

4 Save as test.ice
5 Make Script global (???)
6 Update Scripts    -

 got the expected "Re-Loading Script Engine Files"


But nothing happens. "View Script File" says No Scripts

loaded
and no Echo appears.

What is wrong?

Thank's in advance.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
NOOB Question - How to create a script
« Reply #1 on: April 23, 2004, 12:24:10 PM »
You have a ' character in front of the Echo command, this

makes the script ignore that line, so remove that character.

There is no need to make the script global. Global

scripts are bessed use to carry variables and sub/functions that you want all your script files to be able to access, as

normally, each script file is seperate from the other, not being able to access each others subs.  Making a script file

global allows to have the sub/function/variables accessable by all script files.

Your echo command also makes it go to

the channel "#channel", if you want to replace this with the actual channel that the ONTEXT event uses, replace "#channel"

with just Channel.

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
Echo "I want to add this

Text",Channel,ServerNumber
End Sub

Instead of "Update Scripts", choose "Close and Update Scripts", which will

close the Script Editor.

You should then see that Reloading Scripts message, and then Loading test.ice into Script

Engine.
The IceChat God

MklKvh

  • Newbie
  • *
  • Posts: 25
NOOB Question - How to create a script
« Reply #2 on: April 23, 2004, 01:26:47 PM »
That's my problem.

I  choosed "Close and Update

Scripts", which asked me for the skript name and closed the Script Editor.

The new Script (test.ice") is in the

scripts SubDir.
Containing:

  Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)
  Echo "I want to add

this Text",Channel,ServerNumber
  End Sub


I got a Reloading Scripts message,.

But no loading test.ice

into Script Engine. And nothing else happens.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
NOOB Question - How to create a script
« Reply #3 on: April 23, 2004, 02:37:27 PM »
Well, really, thats all there is to it.

Version 5.20 is

close to being released, it seems to work a bit better with this anyways.

What you can also try, is open the

icechat.ini file, and go to the [Scripts] section, and just add
n0=test.ice

And then re-start icechat, and see if

it loads the test.ice file.
The IceChat God

MklKvh

  • Newbie
  • *
  • Posts: 25
NOOB Question - How to create a script
« Reply #4 on: April 23, 2004, 02:54:32 PM »
Thanks! That solved my problem.
There was a unknown

ONRAW.ICE at position n0

My Scripts came behind this unknown and not existing script.
Seems there is a "File not

found" Error-Message missing.

Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
NOOB Question - How to create a script
« Reply #5 on: April 23, 2004, 03:38:31 PM »
Ah, yes, that would do it.

Perhaps onraw.ice was loaded

at one time, and not properly removed.

In any case, glad the problem is solved.
The IceChat God

MklKvh

  • Newbie
  • *
  • Posts: 25
NOOB Question - How to create a script
« Reply #6 on: April 23, 2004, 05:37:17 PM »
Yes, I'm glad too.  :D

I wrote my first scripts,

solving perfect my needs.

Thanks for that quick and efficient help. IceChat is an excellent IRC Client and from now on

the one I use.

If you need one day help with a german version, don't hesitate to ask. I'll be proud if I could

support you.  :D