Author Topic: very simple script  (Read 19143 times)

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #15 on: August 11, 2005, 01:46:24 AM »
I still get the same message
"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: very simple script
« Reply #16 on: August 11, 2005, 06:48:35 AM »
Try just $read(test.txt) , without the line number, and see what happens.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #17 on: August 11, 2005, 08:35:45 AM »
<Moriobot> $read(test.txt)
"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: very simple script
« Reply #18 on: August 11, 2005, 11:42:28 AM »
Are you running IceChat 5.50 ? Because it is not parsing that $identifier, so that it was I suspect, as it is new to 5.50.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #19 on: August 11, 2005, 12:06:49 PM »
I'm running IceChat 5.50 Build 010905
"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: very simple script
« Reply #20 on: August 11, 2005, 01:37:37 PM »
You know what, I realize the problem now, after doing some digging.
5.50 has a bug with $read , which I did manage to fix in 5.51.
I just never released the fix. I will upload the 5.51 version and I will
send you a message when that is done.

Sorry for all the confusion.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #21 on: August 12, 2005, 12:58:57 AM »
ok, thank you for all the help
"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

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #22 on: August 12, 2005, 01:20:57 AM »
fgs...still just the same message
"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

ADB

  • Newbie
  • *
  • Posts: 47
Re: very simple script
« Reply #23 on: August 12, 2005, 02:24:22 AM »
Ok, thank you once again, but I still won't get the $read thing to work

this is the full code

Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                           
if Message = "H" then       
    Getidentifier("$read(test.txt,1)")                       
SendCommand "/msg " & channel & " $read(test.txt, 1)", ServerNumber                 
end if                         
End Sub                           


You did it wrong, it should be like this.
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                           
if Message = "H" then                 
  SendCommand "/msg " & channel & " $read(test.txt, 1)", ServerNumber                 
end if                         
End Sub                           


Shouldn't it be either

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                           
if Message = "H" then                 
  SendCommand "//msg " & Channel & " $read(test.txt, 1)", ServerNumber                 
end if                         
End Sub                           

or

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                           
if Message = "H" then
  SendCommand "/msg " & Channel & " " & GetIdentifier("$read(test.txt, 1)"), ServerNumber                 
end if                         
End Sub                           

?

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #24 on: August 12, 2005, 02:36:29 AM »
thanks, that works, but in the en of the line I get a "1)"
and if I set the linenumber to "2" then I get "2)"
"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: very simple script
« Reply #25 on: August 12, 2005, 07:04:48 AM »
Yes, you need to remove the space in $read(text.txt, 2) .. it should be $read(text.txt,2) , no space between the comma and the line number.
The IceChat God

Morio

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 256
Re: very simple script
« Reply #26 on: August 12, 2005, 07:19:14 AM »
Now the script is working as it should, thanks for the help everyone
"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

AM3

  • Newbie
  • *
  • Posts: 3
Re: very simple script
« Reply #27 on: August 26, 2005, 10:17:03 AM »
Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                           
if Message = "Hello" then
  SendCommand "/msg " & Channel & " " & GetIdentifier("$read(test.txt, 1)"), ServerNumber                 
end if                         
End Sub                           

This worked test.txt , answers "Hello"

Then i writte the new in the same place below and created new test2.txt in script folder:

Code: [Select]
Sub ONTEXT(Message,Channel,Nickname,Host,ServerNumber)                           
if Message = "HI 4 all" then
  SendCommand "/msg " & Channel & " " & GetIdentifier("$read(test2.txt, 1)"), ServerNumber                 
end if                         
End Sub                           

And when some one types Hi 4 all , the message cames "Hello" from first GetIdentifier("$read(test.txt, 1)"), ServerNumber but not from the test2.txt "Hi 4 you too"

whats the problem here?




Snerf

  • Administrator
  • Hero Member
  • *****
  • Posts: 1968
    • IceChat IRC Client
Re: very simple script
« Reply #28 on: August 26, 2005, 03:28:18 PM »
First of all, you have spaces in your identifier call again.
Are you using 2 different ONTEXT sub's in the same script file?
Combine them into 1.
The IceChat God