Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Greater Then: if(5>99) Less Then: if(5<99)
#1
Hello, I'm wondering if somebody could help me figure out how to do Greater Than, Less Than.

For Example:

Code:
Copy      Help
str+ less.getwintext(id(someid ""));; an id & a Window
rep
,if(less>90,000)end;; I want this to mean, if the stored text in the variable (less) is greater than 90,000 then end. If not then exacute code after else.
,else
,,;;DO THIS CODE
#2
youre trying to use a str variable as an integer "<" and ">" are for numbers. youll need to change the str value to a number first and then compare it to "90,000".

look up "val" in the help to find out its sytax.
An old blog on QM coding and automation.

The Macro Hook
#3
Wow! thanks a lot Ken, just what I was looking for.

--
I came up with this, & tested by typeing 91000 in my Address Bar. ( id(1001<adress bar id "Browser Name")

Code:
Copy      Help
str+ less.getwintext(id(1001 "Crazy Browser")); int a=val(less)
rep
,if(a>90000);end
,else
,,out "Nope"

But what if I need to look at commas?

Example:

if(a>90,000);end
else
,do this...
--

Wow , NeverMind I got it Big Grin , that's some smart thinking the way that is done.
#4
nice rebuy , but there is an easier way bro!
#5
meanmuggin Wrote:nice rebuy , but there is an easier way bro!

Rebuy? what are you talking about? this isn't a rebuy. lol
---
Edit: Seriously this is not a rebuy & this will be used for many things in my macros not relating to gaming in any way. :lol: for 1, & for 2 , please don't post anything relateing to gaming on this site.

For Instance:
Code:
Copy      Help
opt hidden 1
but+ 131"Calc";; 7
but+ 126"Calc";; 2
but+ 130"Calc";; 6
but+ 91"Calc";; *
but+ 127"Calc";; 3
but+ 132"Calc";; 8
but+ 133"Calc";; 9
but+ 112"Calc";; =
str s.getwintext(id(403"Calc"));; Results
if(s<"300000.")out "300,000 Is Greater Than The Results Of My Math Problem."
else
,out "My Results Are Greater Than 300,000"
#6
I'm not really understanding how to compare the grabbed number to a number with a comma.

This is what I've tried so far:
Code:
Copy      Help
int i
str s.getwintext(id(1001"Crazy Browser"));val(s);; as an example test, I type 99,000 in my Adress bar. Then run this.
val(s 1 i );; and also what if the # in my Adress bar is like 300? then the results of i would be 3. Is there just an easy way to put
;something like if(s>99,000)end;else;do this? I don't understand how I could put 99,000 into a variable or something, without the "99,000" quotes. So it works.

out i;; here ( i ) is how many places over the decimal point is, in this case a ',' & it would be 2.
if i>2;end;; meaning if the # in my address has a ',' farther over then 2 places it will end, but what if it's like 10,275,381 in my Adress bar. That will also be 2 places over.
else
,_s="99000"; _s.setwintext(id(1001"Crazy Browswer"))
,end


So mainly what I'm looking for, is a way to do this like this:
Code:
Copy      Help
str s.getwintext(id(1001"Crazy Browser"))
if s>99,000;end;;But this throws an error, saying: missing (, or ;.
else
,_s="99000"; _s.setwintext(id(1001"Crazy Browswer"))
,end
#7
meanmuggin Wrote:nice rebuy , but there is an easier way bro!


You've said in previous statements about "witch hunting" or picking out people who are using this for games and yet you are picking out people yourself. I don't see how this is game related either.
Taking on Quick Macros one day at a time


Forum Jump:


Users browsing this thread: 1 Guest(s)