AutoHotkey Community

It is currently May 27th, 2012, 3:33 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: Toogle script?
PostPosted: October 31st, 2005, 12:43 am 
Is there a toogle function?

For example, I use just one button to turn switch a setting and to reset it.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 4:03 am 
Offline

Joined: October 7th, 2005, 9:46 pm
Posts: 13
I don't think there is an explicit toggle function. Making a button do 2 different actions is relatively simple. Here is an example of what I think you're looking for. You can change the if statement to suit your purpose.

Code:
Status = On
Gui, Add, Button, Default, &Toggle
Gui, Show,, Toggle
return

ButtonToggle:
If Status = On
{
  Status = Off
  MsgBox, Toggle Off
}
else
{
  Status = On
  MsgBox, Toggle On
}
return

GuiClose:
ExitApp


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 4:34 am 
o sorry, I mean a "bind" toggle. So being able to toggle between settings by clicking my right mouse button.

The starting value is "4" and the other value is "2". So its not a on/off fuction.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 12:27 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Maybe this?
Code:
Status := True
Gui, Add, Button, Default vBtnToggle gBtnToggle, &Toggle 4
Gui, Show,, Toggle
return

BtnToggle:
  If Status
    GuiControl,, BtnToggle, &Toggle 2
  else
    GuiControl,, BtnToggle, &Toggle 4   
  Status := not Status
return

GuiClose:
ExitApp

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 1:36 pm 
Do I need a gui button? Which button do I bind?

The idea is.. I press my right mouse button and in the game I play the mouse sensitivity will change from 4 to 2 and back again on the second click.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 1:43 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
No, you do not need a GUI button.

You can use a hotkey for the mouse as well.

Please have a look at the manual on Hotkeys.

How dou you want to change the mouse sensitivity? Do you have a program you can use for that, does the game do it, or should AHK manipulate the mouse?

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 2:29 pm 
Is it possible for AHK to change a setting in my game?

So I click mouse to swap between two different game settings in game.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 4:23 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
Can you do it currently manually in the game with a shortcut?
What do you have to do manually?

_________________
Ciao
toralf
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: October 31st, 2005, 4:25 pm 
Offline

Joined: January 31st, 2005, 9:50 am
Posts: 3910
Location: Bremen, Germany
There's an item in the documentation about using Send in games: Why don't Hotstrings, Send, and MouseClick work in certain games?. Please have a look.

_________________
Ciao
toralf
Image


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, Wicked, Yahoo [Bot] and 14 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