![]() |
|
[Trove] Quick Class Changer Using Autohotkey (Download) - Printable Version +- Sick Gaming (https://sickgaming.net) +-- Forum: Console, Mobile, and PC Gaming (https://sickgaming.net/forum-119.html) +--- Forum: PC Discussion (https://sickgaming.net/forum-13.html) +--- Thread: [Trove] Quick Class Changer Using Autohotkey (Download) (/thread-116323.html) |
[Trove] Quick Class Changer Using Autohotkey (Download) - xSicKxBot - 09-18-2015 Quick Class Changer Using Autohotkey Game: Trove Details This was made by request of @cryophobe https://sickgaming.net/thread-116354.html First off this is something that only took me about hour to make. So there might be type o's and mistakes. Please do tell me where they are so I can make sure to fix them in later releases as needed. GUI sample: This is a vary basic and simple program. It uses on screen coords that you set. These settings are saved and displayed on the GUI. Maybe later if we figure out how to packet inject we could do a better job but for now this is what works. Also if you know what you are doing you can add more hotkeys. I have it setup for 4 . But it can easily add more with a few extra lines. If you have any questions or comments or ideas to improve please do share. Please do hit the thank button if you use this. It keeps us coders wanting to code seeing others use our stuff. And Please do give credit where credit is due if you use my code. Issues: This will not work for classes you have to scroll down to see the Switch button. Sorry I never use the knight which is the hidden one for me. So maybe later if more classes are added and we need to scroll down I will add a feature for that. Warning: Make sure the characters you switch to are evenly geared hp wise. Other wise you will notice a huge drop in HP. So if you ask "WHERE DID MY HP GO". Well now you know. How to use. First open the game and the program. Next you want to hit J to open the classes. Then put your mouse over the switch button. Hit F5, F6, F7 or F8. You will see a tooltip saying that the coords are saved. These are wrote to a inifile for later use so you wont have to calibrate it all the if the screen never moves. Once you have the class set to that hot key just hit that hotkey again and it will change to that class. If you like to reset the coords for that hotkey. You can hold Shift + the hotkey you wish to reset. Or you can also use the button under each class on the GUI it does the same thing for that class. Autohotkey Source: Version 1.0 Code:Copy Code: ;Version 1.0
;First Release
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
IfNotExist, %A_ScriptDir%/SpamChat.ini
{
;Default Settings.
IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY
IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassIsSet
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassCoordsX
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassCoordsY
IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassIsSet
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassCoordsX
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassCoordsY
IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassIsSet
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassCoordsX
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassCoordsY
} else {
IniRead, FirstIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet
IniRead, FirstXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX
IniRead, FirstYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY
FirstCoords = %FirstXPos%,%FirstYPos%
IniRead, SecondIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet
IniRead, SecondXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX
IniRead, SecondYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY
SecondCoords = %SecondXPos%,%SecondYPos%
IniRead, ThirdIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet
IniRead, ThirdXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX
IniRead, ThirdYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY
ThirdCoords = %ThirdXPos%,%ThirdYPos%
IniRead, FourthIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet
IniRead, FourthXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX
IniRead, FourthYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY
FourthCoords = %FourthXPos%,%FourthYPos%
}
Gui, Add, Text, x12 y9 w180 h20 , First Class
Gui, Add, Text, x12 y29 w80 h20 , Is it set?
Gui, Add, Text, x92 y29 w100 h20 vFirstSet , %FirstIsSet%
Gui, Add, Text, x12 y49 w80 h20 , Mouse Coords:
Gui, Add, Text, x92 y49 w100 h20 vFirstCoords, %FirstCoords%
Gui, Add, Button, x12 y69 w180 h20 gFirstClassReset, First Class Reset
Gui, Add, Text, x202 y9 w180 h20 , Second Class
Gui, Add, Text, x202 y29 w80 h20 , Is it set?
Gui, Add, Text, x282 y29 w100 h20 vSecondSet, %SecondIsSet%
Gui, Add, Text, x202 y49 w80 h20 , Mouse Coords:
Gui, Add, Text, x282 y49 w100 h20 vSecondCoords, %SecondCoords%
Gui, Add, Button, x202 y69 w180 h20 gSecondClassReset, Second Class Reset
Gui, Add, Text, x392 y9 w180 h20 , Third Class
Gui, Add, Text, x392 y29 w80 h20 , Is it set?
Gui, Add, Text, x472 y29 w100 h20 vThirdSet, %ThirdIsSet%
Gui, Add, Text, x392 y49 w80 h20 , Mouse Coords:
Gui, Add, Text, x472 y49 w100 h20 vThirdCoords, %ThirdCoords%
Gui, Add, Button, x392 y69 w180 h20 gThirdClassReset, Third Class Reset
Gui, Add, Text, x582 y9 w180 h20 , Fourth Class
Gui, Add, Text, x582 y29 w80 h20 , Is it set?
Gui, Add, Text, x662 y29 w100 h20 vFourthSet, %FourthIsSet%
Gui, Add, Text, x582 y49 w80 h20 , Mouse Coords:
Gui, Add, Text, x662 y49 w100 h20 vFourthCoords, %FourthCoords%
Gui, Add, Button, x582 y69 w180 h20 gFourthClassReset, Fourth Class Reset
Gui, Add, Text, x12 y99 w750 h60 , How to use?`nIn game Hit J then put your mouse over the Switch Icon. Hit F4`,F5`,F6 or F8. This will set the class to that hotkey. Just hit that key to switch. If you need to reset the coords. Just hold Shift and hit that hotkey or hit the Reset button under the class on the GUI. Also this will not work for classes that you have to scroll down for. To lazy to program the scroll for the knight sorry. Maybe I will do it later. Any other questions feel free to post on the http://www.mpgh.net/ post.
Gui, Show, x272 y159 h163 w775, Quick Class Changer by Nipper
Return
;Hotkeys
F5::ClassChange("First")
+F5::
{
FirstClassReset:
ClassReset("First")
Return
}
F6::ClassChange("Second")
+F6::
{
SecondClassReset:
ClassReset("Second")
Return
}
F7::ClassChange("Third")
+F7::
{
ThirdClassReset:
ClassReset("Third")
Return
}
F8::ClassChange("Fourth")
+F8::
{
FourthClassReset:
ClassReset("Fourth")
Return
}
;F9::Reload
ClassChange(ClassNumber) {
;Check if the class is set in the Ini
IniRead, IsClassSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet
If IsClassSet = Yes
{
IniRead, XPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsX
IniRead, YPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsY
ToolTipDisplay("Changing Class")
BlockInput, on
Send j
Sleep 400
MouseClick, Left, %XPos%, %YPos%
BlockInput, off
} else
{
MouseGetPos, XPos, YPos
MouseCoords = %XPos%,%YPos%
IniWrite, Yes, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet
IniWrite, %XPos%, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsX
IniWrite, %YPos%, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsY
GuiControl,, %ClassNumber%Set, Yes
GuiControl,, %ClassNumber%Coords, %MouseCoords%
ToolTipDisplay(ClassNumber . " Class is not set setting now.`nCoords: " . MouseCoords)
}
return
}
ClassReset(ClassNumber) {
;Check if the class is set in the Ini
IniRead, IsClassSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet
If IsClassSet = Yes
{
ToolTipDisplay("Resetting " . ClassNumber . " Class")
ClassCoords = 0,0
IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsX
IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsY
GuiControl,, %ClassNumber%Set, No
MouseCoords = 0,0
GuiControl,, %ClassNumber%Coords, %MouseCoords%
} else
{
ToolTipDisplay("Class was not set nothing to reset.")
}
return
}
ToolTipDisplay(Message) {
ToolTip, %Message%
SetTimer, RemoveToolTip, 5000
return
}
RemoveToolTip:
SetTimer, RemoveToolTip, Off
ToolTip
return
GuiClose:
ExitAppVersion 1.1 ;Version 1.1 ;Fixed a typo I left when loading the ini that would only show the first class loaded in the qui across all classes. My bad for me being lazy. ;Version 1.0 ;First Release #NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases. ; #Warn ; Enable warnings to assist with detecting common errors. SendMode Input ; Recommended for new scripts due to its superior speed and reliability. SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory. IfNotExist, %A_ScriptDir%/SpamChat.ini { ;Default Settings. IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassIsSet IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassCoordsX IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassCoordsY IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassIsSet IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassCoordsX IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassCoordsY IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassIsSet IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassCoordsX IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassCoordsY } else { IniRead, FirstIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassIsSet IniRead, FirstXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsX IniRead, FirstYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FirstClassCoordsY FirstCoords = %FirstXPos%,%FirstYPos% IniRead, SecondIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassIsSet IniRead, SecondXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassCoordsX IniRead, SecondYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, SecondClassCoordsY SecondCoords = %SecondXPos%,%SecondYPos% IniRead, ThirdIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassIsSet IniRead, ThirdXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassCoordsX IniRead, ThirdYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, ThirdClassCoordsY ThirdCoords = %ThirdXPos%,%ThirdYPos% IniRead, FourthIsSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassIsSet IniRead, FourthXPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassCoordsX IniRead, FourthYPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, FourthClassCoordsY FourthCoords = %FourthXPos%,%FourthYPos% } Gui, Add, Text, x12 y9 w180 h20 , First Class Gui, Add, Text, x12 y29 w80 h20 , Is it set? Gui, Add, Text, x92 y29 w100 h20 vFirstSet , %FirstIsSet% Gui, Add, Text, x12 y49 w80 h20 , Mouse Coords: Gui, Add, Text, x92 y49 w100 h20 vFirstCoords, %FirstCoords% Gui, Add, Button, x12 y69 w180 h20 gFirstClassReset, First Class Reset Gui, Add, Text, x202 y9 w180 h20 , Second Class Gui, Add, Text, x202 y29 w80 h20 , Is it set? Gui, Add, Text, x282 y29 w100 h20 vSecondSet, %SecondIsSet% Gui, Add, Text, x202 y49 w80 h20 , Mouse Coords: Gui, Add, Text, x282 y49 w100 h20 vSecondCoords, %SecondCoords% Gui, Add, Button, x202 y69 w180 h20 gSecondClassReset, Second Class Reset Gui, Add, Text, x392 y9 w180 h20 , Third Class Gui, Add, Text, x392 y29 w80 h20 , Is it set? Gui, Add, Text, x472 y29 w100 h20 vThirdSet, %ThirdIsSet% Gui, Add, Text, x392 y49 w80 h20 , Mouse Coords: Gui, Add, Text, x472 y49 w100 h20 vThirdCoords, %ThirdCoords% Gui, Add, Button, x392 y69 w180 h20 gThirdClassReset, Third Class Reset Gui, Add, Text, x582 y9 w180 h20 , Fourth Class Gui, Add, Text, x582 y29 w80 h20 , Is it set? Gui, Add, Text, x662 y29 w100 h20 vFourthSet, %FourthIsSet% Gui, Add, Text, x582 y49 w80 h20 , Mouse Coords: Gui, Add, Text, x662 y49 w100 h20 vFourthCoords, %FourthCoords% Gui, Add, Button, x582 y69 w180 h20 gFourthClassReset, Fourth Class Reset Gui, Add, Text, x12 y99 w750 h60 , How to use?`nIn game Hit J then put your mouse over the Switch Icon. Hit F4`,F5`,F6 or F8. This will set the class to that hotkey. Just hit that key to switch. If you need to reset the coords. Just hold Shift and hit that hotkey or hit the Reset button under the class on the GUI. Also this will not work for classes that you have to scroll down for. To lazy to program the scroll for the knight sorry. Maybe I will do it later. Any other questions feel free to post on the http://www.mpgh.net/ post. Gui, Show, x272 y159 h163 w775, Quick Class Changer by Nipper Return ;Hotkeys F5::ClassChange("First") +F5:: { FirstClassReset: ClassReset("First") Return } F6::ClassChange("Second") +F6:: { SecondClassReset: ClassReset("Second") Return } F7::ClassChange("Third") +F7:: { ThirdClassReset: ClassReset("Third") Return } F8::ClassChange("Fourth") +F8:: { FourthClassReset: ClassReset("Fourth") Return } ;F9::Reload ClassChange(ClassNumber) { ;Check if the class is set in the Ini IniRead, IsClassSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet If IsClassSet = Yes { IniRead, XPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsX IniRead, YPos, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsY ToolTipDisplay("Changing Class") BlockInput, on Send j Sleep 400 MouseClick, Left, %XPos%, %YPos% BlockInput, off } else { MouseGetPos, XPos, YPos MouseCoords = %XPos%,%YPos% IniWrite, Yes, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet IniWrite, %XPos%, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsX IniWrite, %YPos%, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsY GuiControl,, %ClassNumber%Set, Yes GuiControl,, %ClassNumber%Coords, %MouseCoords% ToolTipDisplay(ClassNumber . " Class is not set setting now.`nCoords: " . MouseCoords) } return } ClassReset(ClassNumber) { ;Check if the class is set in the Ini IniRead, IsClassSet, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet If IsClassSet = Yes { ToolTipDisplay("Resetting " . ClassNumber . " Class") ClassCoords = 0,0 IniWrite, No, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassIsSet IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsX IniWrite, 0, %A_ScriptDir%/SpamChat.ini, ClassChanger, %ClassNumber%ClassCoordsY GuiControl,, %ClassNumber%Set, No MouseCoords = 0,0 GuiControl,, %ClassNumber%Coords, %MouseCoords% } else { ToolTipDisplay("Class was not set nothing to reset.") } return } ToolTipDisplay(Message) { ToolTip, %Message% SetTimer, RemoveToolTip, 5000 return } RemoveToolTip: SetTimer, RemoveToolTip, Off ToolTip return GuiClose: ExitApp Version 1.0 Report virustotal report URL SHA256: 48acc5df231d3b111dc79b75cec0950eb12ff91d3c8354f105 7d02e273780da7 File name: Quick Class Changer1.0.rar Detection ratio: 1 / 56 Analysis date: 2015-08-18 01:30:54 UTC ( 0 minutes ago ) Version 1.1 Report virustotal report URL SHA256: 59a78c82c9965995c77703367d26bf318e83acfe8910681218 6922ffb4f8ae18 File name: Quick Class Changer1.1.rar Detection ratio: 1 / 56 Analysis date: 2015-08-18 16:41:01 UTC ( 0 minutes ago ) Download: As always, use caution. This file is provided for archival purposes. SickGaming cannot be held liable. |