CubeScript examples for reference.xml
#4
RandumKiwi, that list you made is great, it is the only thing I used to create my scripts. now if someone could PM me on how to make the "Code boxes".......
Sorry but I didn't understand the format of your example, perhaps an example with actual code and also how you want it formatted to be 100% clear, or I need more than 2.5 hours of sleep.

I seem to recall that bind differently (mostly for admins)

alias hb [ hackercn = $arg1; setadmin 1 *password*; vote 2; whois $arg1; sleep 500 [ban ( hackercn ) Hacking; sleep 500 [ screenshot ] ] ]


You need to change *password*

To make it work properly you need admin to cancel any current vote and make sure the vote passes. Without setadmin you must wait till no other vote is pending (or claim admin first).

to ban lets say cn4 just type /hb 4

the /hb calls the script, $arg1 is the cn number of the player you are wanting to ban (4 in this example).
I had to add hackercn = $arg1 because for some reason it would not pass the value properly to the ban statement. (think I know why but a proper explanation would be nice)

setadmin is needed to get full IP and make sure vote passes.

vote 2 is the same as pressing F2, if there is a vote pending and you have admin then pending vote fails.

whois $arg1 displays the IP of the cn you picked (4 in this example).

the next part is a problem for most and it has to do with nested sleep commands
sleep 500 [ban ( hackercn ) Hacking; sleep 500 [ screenshot ] ]
The first part sleep 500[----] gives the server time (500 milliseconds) to accept you as admin before doing anything inside of [ ]

next we have ban ( hackercn ) Hacking, this is the ban vote for the cn you picked (4 in this example) with the reason as Hacking. For some reason I am not sure of, when I used $arg1 here it would always be zero.

the last part sleep 500 [ screenshot ] gives the server time to ban the player then takes a screenshot.
Thanks given by:


Messages In This Thread
RE: CubeScript examples for reference.xml - by [SODA]___ME___ - 17 Oct 12, 06:36PM