Dicemaster Slayer Posted January 25, 2008 Posted January 25, 2008 (edited) [EDIT] *SOLVED* Thanks to everyone that helped Edited January 26, 2008 by Dicemaster Slayer
Developers Jos Posted January 25, 2008 Developers Posted January 25, 2008 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 SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
Dicemaster Slayer Posted January 25, 2008 Author Posted January 25, 2008 Sorry about the textwall, but even including Number() around the variables, 18 should not be considered less than 5.
martin Posted January 25, 2008 Posted January 25, 2008 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.
weaponx Posted January 25, 2008 Posted January 25, 2008 You are using a 4-dimensional array, that is the first sign of bad coding.
martin Posted January 25, 2008 Posted January 25, 2008 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.
blademonkey Posted January 25, 2008 Posted January 25, 2008 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. ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
weaponx Posted January 25, 2008 Posted January 25, 2008 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.
DW1 Posted January 25, 2008 Posted January 25, 2008 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 AutoIt3 Online Help
blademonkey Posted January 25, 2008 Posted January 25, 2008 maybe you need to time travel... ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
McGod Posted January 25, 2008 Posted January 25, 2008 If (Number($player[$user][4][$atk_attacker][0])) > (Number($player[$atk_targetplayer][4][$atk_defender][1])) Then;ATK > DEF [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u]
Linux Posted January 25, 2008 Posted January 25, 2008 LOL you shouldnt use 4d arrays... and what if I store 3d arrays inside an array... You can help! Donate to AutoIt! or, visit ClimatePREDICTION.netMy posts:Travian Bot Example (100+ servers) BETAHow to Host you code/app for free! (unlimited team number) (Public or Private)"Sir, we're surrounded!" "Excellent. We can attack in any direction!"
PsaltyDS Posted January 25, 2008 Posted January 25, 2008 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. 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
weaponx Posted January 25, 2008 Posted January 25, 2008 LOLyou shouldnt use 4d arrays...and what if I store 3d arrays inside an array... I've been known to use nested 2D arrays because is makes recursion easier. I think Pinhead mentioned 4D arrays in Hellraiser though.
blademonkey Posted January 25, 2008 Posted January 25, 2008 (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. LMAO! Now, does your _StringTheoryRegExp() integrate well into _QuantumTheoryRegExpReplace()? Edited January 25, 2008 by blademonkey ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
PsaltyDS Posted January 25, 2008 Posted January 25, 2008 LMAO! Now, does your _StringTheoryRegExp() integrate well into _QuantumTheoryRegExpReplace()?In general, yes, but the special case of _QuantumGravityGet() we got some compile errors... 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
Uten Posted January 25, 2008 Posted January 25, 2008 @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.. Please keep your sig. small! Use the help file. Search the forum. Then ask unresolved questions :) Script plugin demo, Simple Trace udf, TrayMenuEx udf, IOChatter demo, freebasic multithreaded dll sample, PostMessage, Aspell, Code profiling
blademonkey Posted January 25, 2008 Posted January 25, 2008 In general, yes, but the special case of _QuantumGravityGet() we got some compile errors... did you remember to do #include<superpositioning.au3> ? ---"Educate the Mind, Make Savage the Body" -Mao Tse Tung
PsaltyDS Posted January 25, 2008 Posted January 25, 2008 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! 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now