Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

I'm not afk! (For flash games)


  • Please log in to reply
1 reply to this topic
MrAboveAverageScrub
  • Members
  • 2 posts
  • Last active: Jul 11 2015 03:35 PM
  • Joined: 26 Jun 2015

I'm new here, studying as i go.

a post i made asking for guidance with this script got completely ignored, damn you need some residence on this forum...

 

Right, so this script.

It will move your mouse to the location you've triggered it in based on a delay of your preference, Attempting to do so without interrupting your routine facebook browsing experience or whatnot.

- control + left click sets the location

- mouse clicks / movement pause the countdown.

- esc to terminate

- optional tooltip to display some basic infos and remind you that it's still running. ( on by default )

- some instructions and variables to define as you wish at the top of the script

CoordMode, Mouse, Screen
CoordMode, ToolTip, Screen

;	AutoHotKey is required to run this script. - http://www.autohotkey.com/
;	This script moves the mouse to a specified location and back based on an interval.
; 	/Attempting/ to do it while the user is not using the Mouse actively.
;===User input:	==============================================================
Interval_in_Seconds := 7 ; Nudge delay, in seconds.
Tick_Rate_in_Seconds := 0.1 ; Check delay, in seconds,
EnhancedTooltip := True ; Turn off for a tooltip that does not update. regularly.
eTipUpdateInterval := 1 ; Multiplies the tickrate (increases it) for the enhanced tooltip alone. Increase this value to avoid flickering.
;===Decelerations: ==============================================================
Interval := round( Interval_in_Seconds * 1000 )
Tickrate := round( Tick_Rate_in_Seconds * 1000 )
timeOut := round( Interval / tickRate )
;==========================================================================
~^LButton:: ; The Hotkey, you may change it to anything you like.
;For instance: ~^!+Space = (without blocking movement) Control+Alt+Shift + Space .
;List of keys: https://www.autohotkey.com/docs/KeyList.htm
global Active := !Active ; The assigned hotkey is a toggle
if Active {
	MouseGetPos, xStart, yStart ; position to recall to.
	SetTimer, Routine, %tickRate%
} else { 
	SetTimer, Routine, Off
}
if EnhancedTooltip {
	SetTimer, improvedToolTip, % tickRate * eTipUpdateInterval
} else {
	ToolTip, % (Active) ? ( "Starting Position" ) : ("::Paused::`nuse Hotkey to restart`nclick ESC to terminate"),xStart ,yStart,1
}
return
;==========================================================================
Esc::ExitApp ; Termination hotkey.
;==========================================================================
~LButton::Interruption("LButton")
~RButton::Interruption("RButton")
~MButton::Interruption("MButton")
~XButton1::Interruption("XButton1")
~XButton2::Interruption("XButton2")
~wheelup::movAccum := 5
~wheeldown::movAccum := 5
;==========================================================================
Routine: ;Tracks based on the tickRate value at the top of the script.
	MouseGetPos,xCurrent,yCurrent
	
	;The various "Ticks"
	movChk := abs(xCheck-xCurrent + yCheck-yCurrent) ; movChk determines if the mouse is moving
	movAccum += movChk > 0 && movAccum < 2 ? 1 : 0 ;movAccum may be set to grow to higher values-
	movAccum -= movChk < 1 && movAccum > 0 ? 1 : 0 ;-to further delay count based on mouse-actions.
	timeOut -= timeOut > 0 && movAccum = 0 ? 1 : 0 ;The default countdown, ticks to 0 while ^ is at 0
	
	mousegetpos, xCheck, yCheck
	
if (movAccum<1) && (timeOut=0) {
	timeOut := round( Interval / tickRate )
	sum++
	GoSub checkAndMove
	}
return
;==========================================================================
checkAndMove:
    MouseMove,xStart,yStart
    Dance(1000)
    MouseMove,xCurrent,yCurrent
return
;==========================================================================
improvedToolTip: ;Tracker, omit this.
	nudgedTimes := sum ? "Nudge count: " sum : "Script Initiated"
	hold := if Intkey ? Intkey " Is held down" : "On hold"
	yesNo := ( !movAccum ? nudgedTimes : hold )
	ToolTip, % (Active) ? ( yesNo "`nNext nudge in: " FloorDecimal( timeOut / 10, 1 ) ) : ( "use Hotkey to restart`nclick ESC to terminate" ),xStart ,yStart,1
if !Active { ; gets rid of the annoying screen-tear caused by the tooltip updating
	SetTimer, improvedToolTip, Off
}
return
;==========================================================================
Interruption(Key) {
    SetTimer, Routine, Off
    
while getkeystate(key,"D") {
    Global movAccum := 10
    Global Intkey := Key ; couldnt quite work out how to use the return command to return the variable without breaking or rather glitching the loop.
    }
if Active {
    Global Intkey := ""
    
    SetTimer, Routine, %tickRate%
    }
}
;==========================================================================
Dance(SPD){ ;scrap function- moves the mouse left & right a lil.
	BlockInput,MouseMove
	MouseMove,-5,0,SPD,R
	MouseMove,10,0,SPD,R
	MouseMove,-5,0,SPD,R
	BlockInput,MouseMoveOff
}
;=====Credits to SinkFaze for this function===========================================
; http://www.autohotkey.com/board/topic/50826-solved-round-down-a-number-with-2-digits/?p=317619
FloorDecimal(num,dec) {
	return RegExReplace(num,"(?<=\.\d{" dec "}).*$")
}

This is an early version, please report bugs.

Tips & suggestions are also welcomed.

 

I'll start work on a bot for anti-idle: The game, I've already got something basic.

Won't be released until it's better than the one i found with all the dead links.



rodrigomc2000
  • Members
  • 5 posts
  • Last active: Sep 22 2015 05:00 PM
  • Joined: 17 Jun 2015

thanks!