Well after looking at poor beginners, i feel to share some basic knowledge. Im not good at explaining things but i really feel bad for beginners.. so a beginner tutorial wud be nice for them. So heres it, i would like to post..
Creating Alias
1] normal alias
alias vcmp.version !return v1.0
alias vcmp.<aliasname> !return <msg to return>
2] readini alias
alias vcmp.cash !return $iif($readini(vcmp.cash.ini,CASH,$vcmp.name($1)),$v1,0)
alias vcmp.<aliasname> !return $iif($readini(<filename>,<section-in-file>,$vcmp.name($1)),$v1,<else-to-return-if-readini=nothing>)
Commands
on *:SIGNAL:vcmp.command:{
if ($2 == !test) {
vcmp.say Testing Completed
}
elseif ($2 == !hello) || ($2 == !pmhello) {
vcmp.cmdsay $2 %id Hello Everyone
}
elseif ($2 == !test2) {
vcmp.msg %id Test 2 completed
}
else vcmp.msg %id Invalid Command.
}
Now in the commands give above:
Chezor: !test
Testing Completed
Chezor: !hello
Hello Everyone
Chezor: !pmhello
pm >> Hello Everyone
Chezor: !test2
pm >> Test 2 Completed
Chezor: !blablabla
pm >> Invalid Command.
A fill in the blank for beginner :P
elseif ($2 == !<command>) {
vcmp.say <Type here what it will message when command is typed>
}
Some Info
$1 == Server
$2 == Command
$3 == Word after command. Example: !command word.
$4 == Word after word. Example: !command word word2.
and so on
Working with INI
!writeini -n <filename> <SECTION> %name yes
for example !writeini -n vcmp.test.ini TEST %name yes
it will create file vcmp.test.ini
[TEST]
Chezor=yes
!remini -n <filename> <SECTION> %name
it will remove the name from file..
[TEST]
Extras
>= Greater than or equal to
<= Less than or equal to
== Equal to
!= Does not equal to
< Less than
> Greater than
Nice tutorial Chezor ;) now i can "Understand" better some commands... (yes im a noob scripter :P)
You should specify what kind of script this works with, because alot of your information is only true to some scripts.
Btw, an alias doesn't need to start with "vcmp.", it can be anything.
Also your example for readini alias, is not really all that complete. The first example is fine as an exmaple, but the second you left "$vcmp.name($1))". You should specify what type of code should replace that because that's not always what will be used..
Quote from: ReVilo on September 25, 2008, 12:54:01 AM
You should specify what kind of script this works with, because alot of your information is only true to some scripts.
Btw, an alias doesn't need to start with "vcmp.", it can be anything.
Also your example for readini alias, is not really all that complete. The first example is fine as an exmaple, but the second you left "$vcmp.name($1))". You should specify what type of code should replace that because that's not always what will be used..
Yes it doesnt need to start with vcmp.
but this is only basic [based on GUS, i have learned everything from GUS]
trust me some people dont even know this much..
and yes you are right about that $vcmp.name($1)
But i have only given basic man..
!writeini -n vcmp.test.ini TEST %name yes
[TEST]
Chezor=yes
!remini -n vcmp.test.ini TEST %name
[TEST]
while readin ini can be anything which we wrote in ini..
if i wrote the following
!writeini -n vcmp.test.ini TEST %name yes
the following read ini can be used..
($readini(vcmp.test.ini,TEST,%name) == yes)
if ($2 == !check) {
if ($readini(vcmp.test.ini,TEST,%name) == yes) vcmp.msg %id Theres some text in the test file
else {
vcmp.msg %id Theres no text in test file..
}
}
Quote from: ReVilo on September 25, 2008, 12:54:01 AM
You should specify what type of code should replace that because that's not always what will be used..
yeah you r right..
Ok that's fine man, it's just that in the first post you didn't say that it was based on GUS, thus that signal etc would be invalid