Sign in to follow this  
Followers 0
Dicemaster Slayer

5 > 14?

26 posts in this topic

#1 ·  Posted (edited)

[EDIT] *SOLVED*

Thanks to everyone that helped

Edited by Dicemaster Slayer

Share this post


Link to post
Share on other sites



Without even starting to read your "book" and going on the topic title: I am pretty sure you are comparing strings not numbers.

Convert the variables to Numbers by doing Number($var) and see if that solves it ....

Jos


Visit the SciTE4AutoIt3 Download page for the latest versions        Beta files                                                          Forum Rules
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Share this post


Link to post
Share on other sites

Sorry about the textwall, but even including Number() around the variables, 18 should not be considered less than 5.


Share this post


Link to post
Share on other sites

Sorry about the textwall, but even including Number() around the variables, 18 should not be considered less than 5.

I'm sure that it isn't. Can you produce an example which we can run where Number("18") is shown to be less than Number("5")?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

You are using a 4-dimensional array, that is the first sign of bad coding.

Share this post


Link to post
Share on other sites

You are using a 4-dimensional array, that is the first sign of bad coding.

Why is it bad? If you don't need 4 dimensions then ok, but there are times when you need a 4-dimensional array, so what's bad about them?


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

Why is it bad? If you don't need 4 dimensions then ok, but there are times when you need a 4-dimensional array, so what's bad about them?

they melt your brainz.

:D


---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

I say once your array has more than 3 dimensions its time to rethink the logic of your code, and perhaps use the Scripting Dictionary.

Share this post


Link to post
Share on other sites

I say once your array has more than 3 dimensions its time to rethink the logic of your code, and perhaps use the Scripting Dictionary.

I couldn't agree more. I don't think I have ever seen a NEED for a 4-D array

Share this post


Link to post
Share on other sites

maybe you need to time travel...


---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

If (Number($player[$user][4][$atk_attacker][0])) > (Number($player[$atk_targetplayer][4][$atk_defender][1])) Then;ATK > DEF

Share this post


Link to post
Share on other sites

My GrandUnifiedTheory.au3 UDF only works because of 11D arrays in AutoIt. Used to use 20D, but that made my Brane hurt... until I simplified it with my _StringTheoryRegExp() function.

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

LOL

you shouldnt use 4d arrays...

and what if I store 3d arrays inside an array... :D

I've been known to use nested 2D arrays because is makes recursion easier. I think Pinhead mentioned 4D arrays in Hellraiser though.

Share this post


Link to post
Share on other sites

#16 ·  Posted (edited)

My GrandUnifiedTheory.au3 UDF only works because of 11D arrays in AutoIt. Used to use 20D, but that made my Brane hurt... until I simplified it with my _StringTheoryRegExp() function.

:P

LMAO! :D

Now, does your _StringTheoryRegExp() integrate well into _QuantumTheoryRegExpReplace()?

Edited by blademonkey

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

LMAO! :D

Now, does your _StringTheoryRegExp() integrate well into _QuantumTheoryRegExpReplace()?

In general, yes, but the special case of _QuantumGravityGet() we got some compile errors...

:P


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

@Dicemaster. Have you tried to run your sample code? Tried to run it from SciTe4AutoIt3?

How is $atk_defender declared and used?

1: Structur your code (break it up and testable chunks).

2: Use test cases (Search for unit test in the wiki)

How do you log the values returned when 5<4 failes? My guess, your 5 is a space or somethinge else that makes the test valide.

testLessThan()
Exit
func testLessThan()
    LessThan(1, 2)
    LessThan(2, 1)
    LessThan(" ", 4)
    LessThan(4, " ")
EndFunc
Func LessThan($arg1, $arg2)
    If $arg1 > $arg2 Then
        ConsoleWrite("$arg1:?=" & $arg1 & " > $arg2:=" & $arg2 & @crlf)
    EndIf
    Return ($arg1 < $arg2)
EndFunc

Happy coding..:D

Share this post


Link to post
Share on other sites

In general, yes, but the special case of _QuantumGravityGet() we got some compile errors...

:D

did you remember to do #include<superpositioning.au3> ?

---"Educate the Mind, Make Savage the Body" -Mao Tse Tung

Share this post


Link to post
Share on other sites

did you remember to do #include<superpositioning.au3> ?

I started to, but it lead to this:

#include<superpositioning.au3>

$x = 5
$y = "14 "
If $x > $y = True Then MsgBox(16, "Error", "Einstein was wrong!")

So I started writing my own scripting language. AutoIt is obviously too buggy for this stuff!

:D


Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0