StrokesPlus Forum
                       
StrokesPlus Forum
Home | Profile | Register | Active Topics
Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Lua Scripts
 General Action Scripts
 Example from Increment Volume script
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic   

Rob

USA
2573 Posts

Posted - 12/19/2011 :  09:39:35  Show Profile  Visit Rob's Homepage  Reply with Quote
This script gets the current volume and increases it based on how many times the wheel mouse has been scrolled up. The action is defined with Scroll Up, of course.


local iVolume = 0
iVolume = acGetVolume() --Get the current volume
iVolume = iVolume + ((sp_wheel_delta / 1200) * 100) --increase the volume based on the mouse wheel delta (each mouse wheel tick is 120)
if iVolume > 100 then
   iVolume = 100 --set to max volume if above 100, which is the max
end
if iVolume < 0 then
   iVolume = 0 --set to 0 if less than 0
end
acSetVolume(iVolume, 0)
  Previous Topic Topic   
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
StrokesPlus Forum © 2011-2018 Rob Yapchanyk Go To Top Of Page
Snitz Forums 2000