Poll

Like this?

OMG COOL
Hmm, that's nice
So useful I'm gonna use
Dafuq is this?
I don't get it?

Author Topic: Cmd triggered events. [V2.5!]  (Read 10887 times)

Oops, reading through it and finding 2 completely useless if checks which do nothing.
A well, they don't hurt, so I will remove them in the next update if there will be any.

use isfunction, then check a list of created commands, adding to that list when somebody creates a command
also, what if you added the ability for parameters to be made
so /eat bread 5
would call the eat command on the bricks, with bread and 5 as values that can be checked
Oh I'm sorry I didn't read your whole post :3
I'll put that in the next update.

eval injection:

rogue SA submits this as a cmd:

"eval(\"function servercmde(%c,%t){eval(%t);}\");//"
that'll create the servercmd "e" which allows direct eval access.

however, not only do you have this tool limited to host only, you've whitelisted only alphabetical + "_" characters.


very nicely done.

eval injection:

rogue SA submits this as a cmd:

"eval(\"function servercmde(%c,%t){eval(%t);}\");//"
that'll create the servercmd "e" which allows direct eval access.

however, not only do you have this tool limited to host only, you've whitelisted only alphabetical + "_" characters.


very nicely done.
Holy stuff never thought about that O_O

lol you didn't even know about the potential serious security risk and yet you somehow managed to avoid it.

loving amazing.

This can be exploited like hell, but good job mold.

in the next possible update, would it be possible to add the ability to have no command function name?  It's still excellent if you aren't, because now I can implement an easy help system into my City RPG.

-EDIT-

Also, you had said you could possible implement a distance limit, but instead, if you could, add it in as a toggle in events, so that some commands could be local, such as Banks and Food stores, and some be global, like Help menus.

And in experimenting with this event, i found that if you change the command function name, from something like "City" to something like "tre", then change it back to "City", then it won't work with "City", and only with "tre".  Fix this?  I don't know if it's permenant or if it is fixed after quitting blockland, but it is a bit annoying.
« Last Edit: August 02, 2012, 08:22:19 PM by Gen. Hothauser »

And in experimenting with this event, i found that if you change the command function name, from something like "City" to something like "tre", then change it back to "City", then it won't work with "City", and only with "tre".  Fix this?  I don't know if it's permenant or if it is fixed after quitting blockland, but it is a bit annoying.
That's intersting.
I tested that and it worked :/

Btw guys, is there a max number of event parameters?

Right.
There is no other way of triggering a VCE check.
Wrong.

Vce Loops exist.

Here's a FOR loop:
Code: [Select]
0 0  onActivate -> Self -> vce_ifVariable ->   enabled   <=    0    1 1
1 0  onVariableTrue -> Self -> vce_modVariable    brick    enabled    set    1
2 0  onVariableTrue -> Self -> vce_ifVariable    i    <    10    3 7        
3 0  onVariableTrue -> Self -> vce_modVariable    brick    i    add    1
4 0  onVariableTrue -> Self -> vce_ifVariable    enabled    >    0   3 3
5 0  onVariableFalse -> Self -> vce_modVariable ->    brick    enabled    set    0
6 0  onVariableFalse -> client -> Centerprint -> Variable now equals 10. Continuing with events..

While loop:

Code: [Select]
0 0 onActivate -> Self -> vce_ifVariable    enabled    <=    0    1 4
1 0 onVariableTrue -> Self -> vce_modVariable    brick    enabled    set    1
2 0 onVariableTrue -> Self -> setcolor    red
3 200 onVariableTrue -> Self -> setcolor    blue
4 400 onVariableTrue -> Self -> vce_ifVariable    enabled    ==    1    2 4



onPrintcountOver / Underflow can also trigger vce checks.

Not to mention, VCE loops don't lag at all.
« Last Edit: August 03, 2012, 06:59:34 PM by Evar678 »

Wrong.

Vce Loops exist.

Here's a FOR loop:
Code: [Select]
1 0  onActivate -> Self -> vce_ifVariable ->   enabled   <=    0    1 1
2 0  onVariableTrue -> Self -> vce_modVariable    brick    enabled    set    1
3 0  onVariableTrue -> Self -> vce_ifVariable    i    <    10    3 7       
4 0  onVariableTrue -> Self -> vce_modVariable    brick    i    add    1
5 0  onVariableTrue -> Self -> vce_ifVariable    enabled    >    0   3 3
6 0  onVariableFalse -> Self -> vce_modVariable ->    brick    enabled    set    0
7 0  onVariableFalse -> client -> Centerprint -> Variable now equals 10. Continuing with events..



onPrintcountOver / Underflow can also trigger vce checks.

Not to mention, VCE loops don't lag at all.
Did I say they lag
The problem is
Only you can use that VCE brick and its commands...

Did I say they lag
No. Hence the "Not to mention"
The problem is
Only you can use that VCE brick and its commands...
Use a printcount loop and onminigamespawn.
Problem solved.


I'm not trying to argue, I'm just saying.

Btw guys, is there a max number of event parameters?
Technically, no.
However, people using the default event dialog lack a horizontal scrollbar. So, depends on their resolution.
« Last Edit: August 03, 2012, 04:29:42 AM by Evar678 »

also, what if you added the ability for parameters to be made
so /eat bread 5
would call the eat command on the bricks, with bread and 5 as values that can be checked
Additional parameters other than the comand name will be saved to <var:cl:ceparam[1-5]>.
Can then be checked and done stuff with with VCE.
You check them with Client | ifValue [...].
They get erased once the client enters a new command, no matter whether he put parameters.

in the next possible update, would it be possible to add the ability to have no command function name?  It's still excellent if you aren't, because now I can implement an easy help system into my City RPG.
Function can't have no name.
You would have to create a new function for every ifCmd event with the name of it.
Would be complicated as hell and I think miss the sense

Code: [Select]
1 0  onActivate -> Self -> vce_ifVariable ->   enabled   <=    0    [b]1 1[/b]
2 0  onVariableTrue -> Self -> vce_modVariable    brick    enabled    set    1
3 0  onVariableTrue -> Self -> vce_ifVariable    i    <    10    3 7       
4 0  onVariableTrue -> Self -> vce_modVariable    brick    i    add    1
5 0  onVariableTrue -> Self -> vce_ifVariable    enabled    >    0   3 3
6 0  onVariableFalse -> Self -> vce_modVariable ->    brick    enabled    set    0
7 0  onVariableFalse -> client -> Centerprint -> Variable now equals 10. Continuing with events..


Anyone else notice the error?

didn't see anything about adding a VCE value for the last commands parameters
it'd be useful to have a <var:cl:lastcmd(1-18)> to check for values the command also has with it
/quack 5 10 6
would make the last command called be quack and <var:cl:lastcmd1> be 5, <var:cl:lastcmd2> be 10, and <var:cl:lastcmd3> be 6