AutoHotkey Community

It is currently May 26th, 2012, 9:36 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: September 25th, 2008, 6:00 pm 
Offline

Joined: September 21st, 2008, 6:34 am
Posts: 16
I'd like to make the period for Settimer a variable in a script, but AHK wont let me.

Code:
CCADectimer:= 100
settimer, CCADecrease, CCADectimer
[/code]

<edit> most recent post updated with new question.

_________________
Composer
http://www.joshuaevensen.com


Last edited by conchfeld on September 25th, 2008, 7:05 pm, edited 2 times in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2008, 6:02 pm 
Offline

Joined: July 21st, 2008, 4:16 pm
Posts: 726
Location: Calgary, AB, Canada
Code:
CCADectimer:= 100
settimer, CCADecrease, %CCADectimer%


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2008, 6:15 pm 
Offline

Joined: September 21st, 2008, 6:34 am
Posts: 16
Damn, you guys are prompt. This community is really great. Every question I've had has been answered within like a few hours.

_________________
Composer
http://www.joshuaevensen.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2008, 7:03 pm 
Offline

Joined: September 21st, 2008, 6:34 am
Posts: 16
Ok another question now though.

Code:
ZWatch:
if ZWatchEnable = 1
   {
   getkeystate, LeftZ, JoyZ
      if LeftZ between 51 and 97
         {
         Setformat, float, 0.0
         CCWait:= -1((%LeftZ%-100)*4)
         }
      if LeftZ = 50
         {
         return
         }
   }
else
return


This seems to ALMOST WORK except LeftZ ends up having a lot of decimals in it so, in turn, CCWait ends up being like 95.439859439843458 and settimer doesn't like it.

I tried using setformat to turn the floating point numbers im getting back into straight integers, but I couldn't get it working quite right.

Also what exactly do the %%s mean? Do they just tell a function that doesnt normally expect variables that the value is a variable?

_________________
Composer
http://www.joshuaevensen.com


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 25th, 2008, 8:07 pm 
Offline

Joined: June 6th, 2006, 3:19 pm
Posts: 1654
Location: Denmark
Code:
...
  Setformat, float, 0.0
  CCWait:= -((LeftZ-100)*4) ; -1( is wrong, and dont use % in expressions
  MsgBox %CCWait%
...

_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: Exabot [Bot], iBob35555VR, krajan, tomoe_uehara and 68 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group