25 Jul 12, 03:37AM
Spamconnect can be improved at the least, you don't need 2 different menus for each server.
My earlier post in this thread shows one idea on how it could be improved.
Basically, you use an alias (variable) that is either set to 0 (false/off) or 1 (true/on) to determine whether or not to use the "spamconnect" feature when connecting via your menu.
By creating your own subroutine for connecting to servers from your menu, you can check to see if the client has the spamconnect feature enabled:
[cubescript]spamMatchMenuConnects = 1 // use 0 to disable spamconnect
matchMenuConnect = [
serverInfo = (concat $arg1 $arg2 $arg3)
if $spamMatchMenuConnects [
loop smc 3 [ sleep (* $smc 1000) [ say (concat /connect $serverInfo) ] ] // spam the connect to public chat 3 times before connecting if spamconnect is enabled
sleep 3100 [ connect (at $serverInfo 0) (at $serverInfo 1) (at $serverInfo 2) ]
] [
// else spamconnect is disabled, just connect instantly
connect (at $serverInfo 0) (at $serverInfo 1) (at $serverInfo 2)
]
][/cubescript]
Now, instead of using 2 different menus for every server (1 with, 1 without spamconnect), you can use just 1, heres an example:
[cubescript]
newmenu "w00p"
menuitem "idis 28763" [ matchMenuConnect 192.0.0.1 28763 match ]
newmenu "DES"
menuitem "Godsmack" [ matchMenuConnect 255.255.255.255 ][/cubescript]
When you click on the idis 28763 menuitem, alias "matchMenuConnect" is executed and is passed the IP address - 192.0.0.1 - the port - 28763 - and the optional password - match - as arguments.
The "matchMenuConnect" checks if alias (variable) "spamMatchMenuConnects" equals 0, if it does, that means the spamconnect feature is disabled, and the script immediately connects to the sever. IF alias "spamMatchMenuConnects" is not equal to 0, the spamconnect feature is enabled, and the script will print the connect string to public chat 3 times (once per second) before connecting to the server.
If you were to implement the idea the script length would basically be halved, since menu "Private Connects (SpamConnect)" and all of its child menus could be deleted.
My earlier post in this thread shows one idea on how it could be improved.
Basically, you use an alias (variable) that is either set to 0 (false/off) or 1 (true/on) to determine whether or not to use the "spamconnect" feature when connecting via your menu.
By creating your own subroutine for connecting to servers from your menu, you can check to see if the client has the spamconnect feature enabled:
[cubescript]spamMatchMenuConnects = 1 // use 0 to disable spamconnect
matchMenuConnect = [
serverInfo = (concat $arg1 $arg2 $arg3)
if $spamMatchMenuConnects [
loop smc 3 [ sleep (* $smc 1000) [ say (concat /connect $serverInfo) ] ] // spam the connect to public chat 3 times before connecting if spamconnect is enabled
sleep 3100 [ connect (at $serverInfo 0) (at $serverInfo 1) (at $serverInfo 2) ]
] [
// else spamconnect is disabled, just connect instantly
connect (at $serverInfo 0) (at $serverInfo 1) (at $serverInfo 2)
]
][/cubescript]
Now, instead of using 2 different menus for every server (1 with, 1 without spamconnect), you can use just 1, heres an example:
[cubescript]
newmenu "w00p"
menuitem "idis 28763" [ matchMenuConnect 192.0.0.1 28763 match ]
newmenu "DES"
menuitem "Godsmack" [ matchMenuConnect 255.255.255.255 ][/cubescript]
When you click on the idis 28763 menuitem, alias "matchMenuConnect" is executed and is passed the IP address - 192.0.0.1 - the port - 28763 - and the optional password - match - as arguments.
The "matchMenuConnect" checks if alias (variable) "spamMatchMenuConnects" equals 0, if it does, that means the spamconnect feature is disabled, and the script immediately connects to the sever. IF alias "spamMatchMenuConnects" is not equal to 0, the spamconnect feature is enabled, and the script will print the connect string to public chat 3 times (once per second) before connecting to the server.
If you were to implement the idea the script length would basically be halved, since menu "Private Connects (SpamConnect)" and all of its child menus could be deleted.