Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

10 443 Posts in 5 818 Topics- by 1 216 Members - Latest Member: santini862

16 October 2019, 11:35
Select Language English | Russian ru | German
Main PageIRC Client KVIrc forumKVIrc discussionKVIrc scriptingOnChannelMessage syntax needed
Pages: [1]
Print
Author Topic: OnChannelMessage syntax needed  (Read 2176 times)
0 Members and 1 Guest are viewing this topic.
Epsil
Новичок
*

Репутация: 0
Posts: 1


View Profile
« on: 16 January 2016, 21:44 »

I'm trying to make a script that responds to something an IRC bot says with a command for it.

Here's the current code:
if ($3.indexOf"The monsters were protecting" == 0 && $0 == "Batoru"){
%osnovno = "!shop buy item lockpick";
say %osnovno;
%a2 = "!lockpick";
say %a2;
}

I tried having the first bit be "IndexOf(string)" but got this error:
[KVS] Compilation Error: Unexpected character ( (unicode 28) in expression. If it meant to be a string use the quotes.
[KVS]   in script context "OnChannelMessage::default", line 1, near character 15
Event handler OnChannelMessage::default is broken: disabling

It just doesn't work as it is now, and setting the string in the first line to a variable instead and having it check for that in the string ended up making me reply to every single thing automatically.

Is there a way to fix the code I've got now?
Logged
Cabji
Новичок
*

Репутация: 0
Posts: 11


View Profile
« Reply #1 on: 26 March 2016, 13:11 »

can you post a link to where "indexOf" is in kvirc documentation, and I will have a look. I can't find "indexOf" through googling. (Search option for kvirc documentation would be nice!)
Logged
Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic