What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [help!] how to make my own /sevil

[help!] how to make my own /sevil
Author: Message:
guardian-of-souls
Junior Member
**

Avatar
creative mindplay

Posts: 15
37 / Male / –
Joined: Jul 2006
O.P. [help!] how to make my own /sevil
oke i feel like an total noob (probably am to) but how can i make things like /sevil.


i want to use /<command> (need to know how to create this) an then send some text.



please help me

This post was edited on 10-19-2006 at 03:47 PM by guardian-of-souls.
It is the soul you see inside

/i'm an total noob
10-19-2006 03:45 PM
Profile PM Find Quote Report
Felu
Veteran Member
*****


Posts: 2223
Reputation: 72
29 / Male / Flag
Joined: Apr 2006
Status: Away
RE: [help!] how to make my own /sevil
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    if (Message.substr(0, 6) == "/sevil"){
        return'/sound <Soundcode>'
    }
}

function OnGetScriptCommands ()
{
commands  = "<ScriptCommands>";
commands +=     "<Command>";
commands +=         "<Name>sevil</Name>";
commands +=         "<Description>Customized SEVIL</Description>";
commands +=     "</Command>";
commands += "</ScriptCommands>";
return commands;
}

10-19-2006 03:54 PM
Profile E-Mail PM Web Find Quote Report
guardian-of-souls
Junior Member
**

Avatar
creative mindplay

Posts: 15
37 / Male / –
Joined: Jul 2006
O.P. RE: [help!] how to make my own /sevil
thanks
It is the soul you see inside

/i'm an total noob
10-19-2006 04:14 PM
Profile PM Find Quote Report
Plik
Veteran Member
*****

Avatar

Posts: 1489
Reputation: 46
34 / Male / –
Joined: Jun 2004
RE: [help!] how to make my own /sevil
You could also use plus' quick text feature to be able todo this without using a script ;)

This post was edited on 10-19-2006 at 04:28 PM by Plik.
10-19-2006 04:28 PM
Profile PM Find Quote Report
guardian-of-souls
Junior Member
**

Avatar
creative mindplay

Posts: 15
37 / Male / –
Joined: Jul 2006
O.P. RE: [help!] how to make my own /sevil
jah that could but i do not want to change te /sevil or make a marco i want to make an new other one like /swhatever or such and i need to know how to return a text


(it is an learning trip for me)

This post was edited on 10-19-2006 at 05:08 PM by guardian-of-souls.
It is the soul you see inside

/i'm an total noob
10-19-2006 05:01 PM
Profile PM Find Quote Report
Matti
Elite Member
*****

Avatar
Script Developer and Helper

Posts: 1646
Reputation: 39
31 / Male / Flag
Joined: Apr 2004
RE: [help!] how to make my own /sevil
The best way to parse commands is to use regular expressions. An example would be:
code:
function OnEvent_ChatWndSendMessage(ChatWnd, Message){
    var checkExp = /^\/testcmd/i
    if(checkExp.test(Message)){
        return "I've send you a test command!"
    }
}
var checkExp = /^\/testcmd/i declares a new regular expression object, which will give a match when the input string begins with "/testcmd". A regular expression is always placed between two slashes and ends in an optional flag, in this case the i flag which specifies that the expression is not case-sensitive. The ^ defines the beginning of the string and the slash is escaped by a backslash. (otherwise you should get an error)

The test() method of the regular expression object returns true when the input string matches the expression, otherwise it returns false. This method is very handy for making an if-statement to check if the message matches and then execute a block of code.

The OnEvent_ChatWndSendMessage event can return a new message which will replace the entered message. In this case, instead of sending "/mycommand" to your contact, it'll send "I've send you a test command!".

And there you have the basics of script command parsing! ;)

This post was edited on 10-19-2006 at 05:43 PM by Matti.
Plus! Script Developer | Plus! Beta Tester | Creator of Countdown Live | Co-developer of Screenshot Sender 5

Found my post useful? Rate me!
10-19-2006 05:37 PM
Profile E-Mail PM Web Find Quote Report
guardian-of-souls
Junior Member
**

Avatar
creative mindplay

Posts: 15
37 / Male / –
Joined: Jul 2006
O.P. RE: [help!] how to make my own /sevil
thank this helps alot
It is the soul you see inside

/i'm an total noob
10-19-2006 05:46 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On