useful for bots when you want to load a file from another client.
supports error checking, check if files exist and also if files are actually loaded.
you may need to change some stuff to get it to work for you, such as your default script directory and the access level. I might add a setup trigger for this if people really want that.
how to use:
!load foo.bar
will load file 'foo.bar' and outputs status to the current channel
!load -s foo.bar
will load file 'foo.bar' and notices the status to you instead of sending it to the channel.
If you find any problems, please let me know. telling me on IRC is always faster.
;############## SCRIPTLOADER V2 #############
;# #
;# (C) Knoeki/zOWB 2008 #
;# #
;# Visit us at #
;# #
;# http://zomgwtfbbq.info #
;# -OR- #
;# irc.p2p-network.net / #zomgwtfbbq #
;# #
;############################################
on 1600:text:!load*:#: {
if ($2 == $null) {
msg $chan Syntax: !load [-s] foobar.mrc
}
elseif ($2 == -s) {
notice $nick Searching for " $+ $3 $+ "... o.o
if ($exists(scripts\ $+ $3) == $true) {
notice $nick Loading... ^^
/load -rs scripts\ $+ $3
if ($script($3) == $null) {
notice $nick Failed to load file. x.x;
}
else {
notice $nick Ready. ^_^
}
}
else {
notice $nick File not found... >.>;
halt
}
}
else {
msg $chan Searching for " $+ $2 $+ "... .. . o.o
if ($exists(scripts\ $+ $2 $+) == $true) {
msg $chan Loading... ^^
/load -rs scripts\ $+ $2
if ($script($2) == $null) {
msg $chan Failed to load file. (x.x);
}
else {
msg $chan Ready. ^_^
}
}
else {
msg $chan File not found... >.>
}
}
}
Zainul Put [.Code] Code here [./code] without the dots when pasting codes lolol
Eg.
on 1600:text:*:#: {
if ($1 == !load) && (!$2) {
msg $chan Syntax: !load script-name.mrc
}
elseif ($1 == !load) && ($2) {
msg $chan Searching for " $+ $2 $+ "... .. . o.o
if ($exists(scripts\ $+ $2 $+) == $true) {
msg $chan Loading...
timer 1 3 msg $chan Ready ^_^
/load -rs scripts\ $+ $2
}
else {
msg $chan File not found... >.>
}
}
if ($1 == !unload) && (!$2) {
msg $chan Syntax: !Unload script-name.mrc
}
elseif ($1 == !unload) && ($2) {
msg $chan Searching for " $+ $2 $+ "... .. . o.o
if ($exists(scripts\ $+ $2 $+) == $true) {
msg $chan Unloading...
timer 1 3 msg $chan Unloaded
/unload -rs scripts\ $+ $2
}
else {
msg $chan File not found... >.>
}
}
}
Try this i would say it might be more helpfull
syntax for use !load script-name.mrc or !unload script-name.mrc
on 1600:text:*:#: {
if ($1 == !load) && (!$2) {
msg $chan Syntax: !load script-name.mrc
}
elseif ($1 == !load) && ($2) {
msg $chan Searching for " $+ $2 $+ "... .. . o.o
if ($exists(scripts\ $+ $2 $+) == $true) {
msg $chan Loading...
timer 1 3 msg $chan Ready ^_^
/load -rs scripts\ $+ $2
}
else {
msg $chan File not found... >.>
}
}
if ($1 == !unload) && (!$2) {
msg $chan Syntax: !Unload script-name.mrc
}
elseif ($1 == !unload) && ($2) {
msg $chan Searching for " $+ $2 $+ "... .. . o.o
if ($exists(scripts\ $+ $2 $+) == $true) {
msg $chan Unloading...
timer 1 3 msg $chan Unloaded
/unload -rs scripts\ $+ $2
}
else {
msg $chan File not found... >.>
}
}
}