Poll: Do you like this script?
You do not have permission to vote in this poll.
Yes
25.00%
1 25.00%
No
75.00%
3 75.00%
Total 4 vote(s) 100%
* You voted for this item. [Show Results]

C-MOP
#1
Are you confused by using Assault cube's "math operators"?You prefer using C++/C math operators? If so, this script was made for you!!

alias cmop [
    if (strcmp $arg2 +) [
        + $arg1 $arg3
    ] [
    if (strcmp $arg2 -) [
        - $arg1 $arg3
    ] [
    if (strcmp $arg2 *) [
        * $arg1 $arg3
    ] [
    if (strcmp $arg2 div) [
        div $arg1 $arg3
    ] [
    if (strcmp $arg2 mod) [
        mod $arg1 $arg3
    ] [
    if (strcmp $arg2 powf) [
        powf $arg1 $arg3
    ] [
    if (strcmp $arg2 +f) [
        +f $arg1 $arg3
    ] [
    if (strcmp $arg2 -f) [
        -f $arg1 $arg3
    ] [
    if (strcmp $arg2 *f) [
        *f $arg1 $arg3
    ] [
    if (strcmp $arg2 divf) [
        divf $arg1 $arg3
    ] [
    if (strcmp $arg2 modf) [
        modf $arg1 $arg3
    ] [
    if (strcmp $arg2 !) [
        ! $arg1 $arg3
    ] [
    if (strcmp $arg2 ==) [
        = $arg1 $arg3
    ] [
    if (strcmp $arg2 !=) [
        != $arg1 $arg3
    ] [
    if (strcmp $arg2 <) [
        < $arg1 $arg3
    ] [
    if (strcmp $arg2 >) [
        > $arg1 $arg3
    ] [
    if (strcmp $arg2 <f) [
        <f $arg1 $arg3
    ] [    
    if (strcmp $arg2 >f) [
        >f $arg1 $arg3
    ] [    
    if (strcmp $arg2 =f) [
        =f $arg1 $arg3
    ] [
    if (strcmp $arg2 <=) [
        <= $arg1 $arg3
    ] [
    if (strcmp $arg2 >=) [
        >= $arg1 $arg3
    ] [
    if (strcmp $arg2 div=) [
        div= $arg1 $arg3
    ] [
    if (strcmp $arg2 div=f) [
        div=f $arg1 $arg3
    ] [
    if (strcmp $arg2 !=f) [
        + $arg1 $arg3
    ] [    
    if (strcmp $arg2 &&) [
        && $arg1 $arg3
    ] [
    if (strcmp $arg2 ||) [
        || $arg1 $arg3
    ] [ hudecho (c 3) Alias M: Error in second argument ]
    ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ] ]    
]

Usage:

cmop number math-operator number

Ex:

echo cmop 6 + 5

Outputs: 11


PS:

I know that this script is extremely useless but who cares!Its my first time!
Thanks given by:
#2
it looks terrible, dont tell me, there is no list and find function in cube script and what is !=f ?
Thanks given by:
#3
I know :( im trying to make assaultcube's scripting "language" simpler for C++ programers (like me) BTW every operator that ends to f means operator's argument's are float.
Thanks given by:
#4
Also in cubescript there is something called strstr....
Please see the description of it....
Thanks given by:
#5
And its not THAT awfull!

In cubescript:
+ 6 4
In C++:
6 + 4
In my script:
cmop 6 + 4
Thanks given by:
#6
a) even a "C++ programmer" should be able to understand polish notation
b) you should learn cubescript, before you try to "improve" it
c) if you really need that: alias cmop [($arg2 $arg1 $arg3)]
Thanks given by:
#7
Cubescript is annoying, and while C++ is more well-defined, C++ is in no way simpler. Cubescript uses pre-order instead of in-order operators. It's not that bad... C++ may seem simpler, but that's because growing up you were taught in order operators. Pre-order is cleaner. No need for annoying parentheses

In-order:
((1+2)*3+4)/5

Pre-Order
/ + * + 1 2 3 4 5
Thanks given by:
#8
Ok guys DONT judge me that hard as i said its my first time!Its useful for me putting in order!Where is your problem?If you want something PERFECTLY written ask Bukz for it!!!!
Thanks given by:
#9
Stef maybe you should learn cubescript before judging peoples scripts this script has no error and its working perfectly.
Thanks given by:
#10
So, I should learn cubescript, to improve my 21-character script, which outperforms your 80-line monster? I'll get right on it :)
Thanks given by:
#11
Why are you being harsh on him?

His script is clearly more natural than CS is!

Mhtsos job nice! err, I meant nice job Mhtsos!
Thanks given by:
#12
(04 Dec 14, 07:01AM)Mhtsos Wrote: Stef maybe you should learn cubescript before judging peoples scripts this script has no error and its working perfectly.

You tell him bruv
Thanks given by:
#13
(04 Dec 14, 11:30AM)stef Wrote: So, I should learn cubescript, to improve my 21-character script, which outperforms your 80-line monster? I'll get right on it :)

Yeah whatever its too long but I DONT CARE!!!Ok?Share your hate somewhere else!Is it working?If yes shut up and say something good for it!If its not working tell me how to make it work!Too simple!No need to judge!!!!
Thanks given by:
#14
(04 Dec 14, 06:46AM)Mhtsos Wrote: Ok guys DONT judge me that hard as i said its my first time!Its useful for me putting in order!Where is your problem?If you want something PERFECTLY written ask Bukz  for it!!!!

I'm not saying your script is bad, I'm just saying if you know C++, cubescript should be really easy for you. Also, what stef is saying is, when you call a command, say "cmop 1 + 2", 1 is $arg1, + is $arg2, and 2 is $arg3. Therefore, since you are writing the operator out verbatim, it's simpler to write "alias cmop [$arg2 $arg1 $arg3]"
Thanks given by:
#15
"!=f == +" ? Show your naked girlfriend if you want positive feedback so much.
Thanks given by:
#16
(03 Dec 14, 10:53PM)stef Wrote: a) even a "C++ programmer" should be able to understand polish notation
b) you should learn cubescript, before you try to "improve" it
c) if you really need that: alias cmop [($arg2 $arg1 $arg3)]

(04 Dec 14, 01:59PM)Mousikos Wrote:
(04 Dec 14, 06:46AM)Mhtsos Wrote: Ok guys DONT judge me that hard as i said its my first time!Its useful for me putting in order!Where is your problem?If you want something PERFECTLY written ask Bukz  for it!!!!

I'm not saying your script is bad, I'm just saying if you know C++, cubescript should be really easy for you. Also, what stef is saying is, when you call a command, say "cmop 1 + 2", 1 is $arg1, + is $arg2, and 2 is $arg3. Therefore, since you are writing the operator out verbatim, it's simpler to write "alias cmop [$arg2 $arg1 $arg3]"

Stef could say that a better way to write this script is alias cmop [$arg2 $arg1 $arg3]
Thanks given by:
#17
(04 Dec 14, 02:46PM)Alien Wrote: "!=f  == +" ? Show your naked girlfriend  if you want positive feedback so much.

OK XD
Thanks given by:
#18
On such a small engine its better to streamline code as opposed to bloating it.
Thanks given by:
#19
Ok but i just want not being judged SO F*CKING HARD!
Thanks given by:
#20
I'm not judging your coding, I'm judging your little kid rants. You've been here, what? three days, and already you're screaming at people.
Thanks given by:
#21
Ok i feel sorry about it TO EVERYONE ESPECIALLY TO STEF IM SO SORRY
Thanks given by:
#22
OK CAN WE NOW LOCK THE THREAD? :D
Thanks given by:
#23
(04 Dec 14, 09:01PM)Mhtsos Wrote: Ok i feel sorry about it TO EVERYONE ESPECIALLY TO STEF IM SO SORRY

now please apologize for overusing caps.
Thanks given by: