Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ; Ragnarok Online - Auto Potion
- ; Made by Recca
- ; http://ragindex.blogspot.com
- #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
- SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
- SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
- if not A_IsAdmin
- {
- Run *RunAs "%A_ScriptFullPath%" ; Requires v1.0.92.01+
- ExitApp
- }
- Coordmode, Pixel, Screen
- Coordmode, Mouse, Screen
- IniRead, Stop, AutoP Setting.ini, Hotkey, Stop
- IniRead, Start, AutoP Setting.ini, Hotkey, Start
- IniRead, HealthPot, AutoP Setting.ini, Hotkey, HealthPot
- IniRead, ManaPot, AutoP Setting.ini, Hotkey, ManaPot
- IniRead, MsgrNah, AutoP Setting.ini, WarningMsg, Value
- Hotkey, %Stop%, Stop
- Hotkey, %Start%, Start
- Gui, Add, Button, gPickHP, Pick HP coordinate
- Gui, Add, Edit, xp+110 yp+2 w70 h20 vHPCoor +Center
- Gui, Add, Listview, w20 h20 xp+70 vHPColor
- Gui, Add, Text, xp+23 yp+2 vHPp w20,
- Gui, Add, Button, gPickSP x10 y30, Pick SP coordinate
- Gui, Add, Edit, xp+110 yp+2 w70 h20 vSPCoor +Center
- Gui, Add, Listview, w20 h20 xp+70 vSPColor
- Gui, Add, Text, xp+23 yp+2 vSPp w20,
- if MsgrNah = 1
- Gui, Add, Checkbox, xp-17 yp+23 Checked w59 h50 vMsgrNah, Warn`ning`nBox
- else
- Gui, Add, Checkbox, xp-17 yp+23 w59 h50 vMsgrNah, Warn`ning`nBox
- Gui, Add, Text, x10 y60 cRed, HP Potion
- Gui, Add, Hotkey, xp+80 yp w100 +Center Limit190 vHealthButton, %HealthPot%
- Gui, Add, Text, x10 y85 cBlue, SP Potion
- Gui, Add, Hotkey, xp+80 yp w100 +Center Limit190 vManaButton, %ManaPot%
- Gui, Add, Groupbox, x10 y110 w210 h65 cBlue, Hotkeys ( check "AutoP Setting.ini" )
- Gui, Add, Text, xp+10 yp+20, START Hotkey
- Gui, Add, Text, xp+120 yp, STOP Hotkey
- Gui, Add, Hotkey,+Center xp-130 yp+20 w100 h20 vStart Disabled, %Start%
- Gui, Add, Hotkey,+Center xp+109 yp w100 h20 vStop Disabled , %Stop%
- Gui, Add, Button, x10 y185 w100 h25 gSave, Save data
- Gui, Add, Button, xp+110 yp w100 h25 gLoad, Load
- Gui, Add, Text, cBlue x10 y220, By : Recca
- Gui, Add, Link, xp+60 yp, <a href="http://ragindex.blogspot.com">http://ragindex.blogspot.com</a>
- Gui, Show, w245, Auto Potion
- Return
- GuiClose:
- Gui, submit, nohide
- IniWrite, %MsgrNah%, AutoP Setting.ini, WarningMsg, Value
- ExitApp
- return
- Save:
- FileSelectFile, SaveFile, S, %A_ScriptDir%,,*.ini
- If Errorlevel
- return
- Gui, submit, nohide
- IniWrite, %HPCoor%, %SaveFile%.ini, Coordinate, HP
- IniWrite, %SPCoor%, %SaveFile%.ini, Coordinate, SP
- IniWrite, %HealthButton%, %SaveFile%.ini, Hotkey, HP
- IniWrite, %ManaButton%, %SaveFile%.ini, Hotkey, SP
- IniWrite, %HP%, %SaveFile%.ini, Color, HP
- IniWrite, %SP%, %SaveFile%.ini, Color, SP
- return
- Load:
- FileSelectFile, LoadFile, , %A_ScriptDir%,,*.ini
- If Errorlevel
- return
- IniRead, output, %LoadFile%, Coordinate, HP
- GuiControl,, HPCoor, %output%
- StringSplit, temp_, output, `,
- pointBetween := temp_1-39
- perc :=Round(pointBetween/(130/100),0)
- GuiControl,, HPp, %perc%`%
- IniRead, output, %LoadFile%, Coordinate, SP
- GuiControl,, SPCoor, %output%
- StringSplit, temp_, output, `,
- pointBetween := temp_1-39
- perc :=Round(pointBetween/(130/100),0)
- GuiControl,, SPp, %perc%`%
- IniRead, output, %LoadFile%, Hotkey, HP
- GuiControl,, HealthButton, %output%
- IniRead, output, %LoadFile%, Hotkey, SP
- GuiControl,, ManaButton, %output%
- IniRead, output, %LoadFile%, Color, HP
- GuiControl, +Background%output%, HPColor
- HP := output
- IniRead, output, %LoadFile%, Color, SP
- GuiControl, +Background%output%, SPColor
- SP := output
- return
- PickSP:
- Gui, submit, nohide
- if MsgrNah = 1
- {
- MsgBox,49,, After this message box disappear`nthe next location you click will be the coordinate this script moniter`nWhenever the coordinate's color change`, potion will be use`n`nUse ( Alt + Tab ) to switch window and `nI RECOMMEND you to pick coordinate when SP is 100`% FULL
- IfMsgBox, Cancel
- return
- }
- KeyWait LButton, D
- Mousegetpos, x, y
- PixelGetColor, SP, x, y, RGB
- if (SP = 0xFFFFFF or SP = 0xB5B5B5 or SP = 0x5A6BAD)
- {
- MsgBox, 48, Hmmm....., Did you miss the HP/SP bar? try again....
- return
- }
- WinGetActiveTitle, Title
- ToolTip, MARKED
- SetTimer, RemoveToolTip, 500
- if SP = 0x000000
- Loop
- {
- x := x+1
- PixelGetColor, SP, x, y, RGB
- if SP = 0x000000
- Continue
- else
- Break
- }
- GuiControl,, SPCoor, %x%,%y%
- GuiControl, +Background%SP%, SPColor
- pointBetween := x-39
- perc :=Round(pointBetween/(130/100),0)
- ToolTip, %perc%`%
- SetTimer, RemoveToolTip, 1000
- GuiControl,, SPp, %perc%`%
- return
- PickHP:
- Gui, submit, nohide
- if MsgrNah = 1
- {
- MsgBox,49,, After this message box disappear`nthe next location you click will be the coordinate this script moniter`nWhenever the coordinate's color change`, potion will be use`n`nUse ( Alt + Tab ) to switch window and `nI RECOMMEND you to pick coordinate when HP is 100`% FULL
- IfMsgBox, Cancel
- return
- }
- KeyWait LButton, D
- Mousegetpos, x, y
- PixelGetColor, HP, x, y, RGB
- if (HP = 0xFFFFFF or HP = 0xB5B5B5 or HP = 0x5A6BAD)
- {
- MsgBox, 48, Hmmm....., Did you miss the HP/SP bar? try again....
- return
- }
- WinGetActiveTitle, Title
- ToolTip, MARKED
- SetTimer, RemoveToolTip, 500
- if HP = 0x000000
- Loop
- {
- x := x+1
- PixelGetColor, HP, x, y, RGB
- if HP = 0x000000
- Continue
- else
- Break
- }
- GuiControl,, HPCoor, %x%,%y%
- GuiControl, +Background%HP%, HPColor
- pointBetween := x-39
- perc :=Round(pointBetween/(130/100),0)
- ToolTip, %perc%`%
- SetTimer, RemoveToolTip, 1000
- GuiControl,, HPp, %perc%`%
- return
- Start:
- Gui, submit, nohide
- IfWinActive, Auto Potion
- return
- WinGetActiveTitle, Title
- StringSplit, coor1_, HPCoor, `,
- StringSplit, coor2_, SPCoor, `,
- SetTimer, TimerStart, 100
- ToolTip, STARTED
- SetTimer, RemoveToolTip, 500
- return
- TimerStart:
- IfWinActive, Auto Potion
- {
- ToolTip, STOPPED
- SetTimer, TimerStart, off
- SetTimer, RemoveToolTip, 500
- }
- if HP !=
- {
- PixelGetColor, HP1, coor1_1, coor1_2, RGB
- if (HP != HP1)
- {
- ControlSend,, {%HealthButton%},%Title%
- Sleep 20
- }
- }
- if SP !=
- {
- PixelGetColor, SP1, coor2_1, coor2_2, RGB
- if (SP != SP1)
- {
- ControlSend,, {%ManaButton%},%Title%
- Sleep 20
- }
- }
- Return
- Stop:
- IfWinActive, Auto Potion
- return
- ToolTip, STOPPED
- SetTimer, TimerStart, off
- SetTimer, RemoveToolTip, 500
- mode := 0
- Return
- RemoveToolTip:
- ToolTip
- SetTimer, RemoveToolTip, Off
- return
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement