Now onto this snippet. Made this for a friend who wanted a script like !Fact or !joke and wanted to quickly change between them. It will tell you when you load it how to use it, but for kicks and giggles heres the syntax:
/Trigger : will set you trigger, Example [ /Trigger !Joke ] would set !joke for your trigger.
/Tlist : Shows you all available text files you have
/Tfile : sets the file to read from, Example [ /tfile Jokes.txt ] would set jokes.txt to read from.
pretty simple snippet, i used $findfile incase you have such things as a folder for text files and such, it will search threw it all.
Also people are bound to comment on my wierd varible names, its how i number my varibles A threw B then AA AB AC.... then AAA AAB AAC... and so forth, i have alot of scripts as you can tell... xD
alias trigger {
set %bgx $1
echo -a Trigger Set To %Bgx
}
alias tlist {
echo -a Listing Avaible Text Files....
var %x $findfile($mircdir,*.txt,0)
echo -a ( $+ %x $+ ) Number of Files
var %temp.1 1
While (%temp.1 <= %x) {
var %filePath $findfile($mircdir,*.txt,%temp.1)
echo -a $gettok(%filepath,$numtok(%filepath,92),92)
inc %temp.1
}
}
alias tfile {
set %bgy $1
var %w $findfile($mircdir,%bgy,1)
var %z $isfile(%w)
if (%z == $false) {
echo -a File not found
unset %BGY
halt
}
if (%z == $true) {
echo -a File Set To %BGY
Set %bgz %W
}
}
on *:LOAD:{
echo -a Type "/trigger <Trigger>" to set your !trigger to trigger script. EG: /trigger !Jokes
echo -a Type "/Tfile <file>" to set the text file to read from. EG: /Tfile jokes.txt
echo -a Type "/Tlist" to see all availbe text file you can choose from.
}
on *:text:*:#: {
if ($1 == %bgx) {
msg $chan $read(%x)
}
}
on *:INPUT:*: {
if ($1 == %bgx) {
msg $active $Read(%bgz)
}
}
have an new, advanced version of this. http://www.hawkee.com/snippet/6550/
well it's good and ure a dufus lol 4got thats u have cap'd ure first letter Hahaha But yeh so this snippet is good and handy thanks :) but i don't get this bit of the code how does it work please tell me :D (code) on :text::#: {
if ($1 == %bgx) {
msg $chan $read(%x)
}
}
on :INPUT:: {
if ($1 == %bgx) {
msg $active $Read(%bgz)
}
}