Code:
#CommentFlag //
//Current Verson: 2.1
SetDefaultMouseSpeed, 0 //makes your arrow move instantly when using commands
//Run, http:`//era.graalonline.com //remove the //at the start of this line to open era when you open your hotkeys
Global equipX := A_ScreenWidth - 40
Global equipY1 := 150
Global equipY2 := 200
Global neutralX = 0
Global neutralY = 0
Send t //Comment out (//) or delete this line to disable clock on startup of script
//basic movement keys
a::left
w::up
s::down
d::right
//equip1/equip2/grab
q::d
e::s
Lshift::a
//special function 1 and 2
r::z
f::x
//Open Profile
Tab::q
//toggle hotkeys, mainly used to type regularly to chat
`::
Suspend
If(A_IsSuspended){
SoundBeep, 800, //a higher pitched beep will play if hotkeys are turned off
} Else {
SoundBeep //or if they're turned on after toggling then a lower sound will play
}
Return
//Pressing enter after typing chat will automatically turn on hotkeys again
Enter::
Suspend
If(A_IsSuspended){
SoundBeep, 800,
} Else {
SoundBeep
}
Send {Enter}
Return
//command for chatting
y::
Sleep 0
Suspend
Send {Tab}
SoundBeep, 800
Return
//command for guildchat
u::
gChatButtonX := 80
gChatButtonY := 30
BlockInput, MouseMove
CapPos()
Click %gChatButtonX% %gChatButtonY%
ReturnPos()
BlockInput, MouseMoveOff
Suspend
SoundBeep, 800
Return
//for pressing pms and notices
i::
pmButtonX := 120
pmButtonY := 30
BlockInput, MouseMove
CapPos()
Click %pmButtonX% %pmButtonY%
BlockInput, MouseMoveOff
ReturnPos()
Return
//The middle button on a pm (reply)
o::
midButtonX := A_ScreenWidth*0.5
midButtonY := A_ScreenHeight*0.6
BlockInput, MouseMove
CapPos()
Click %midButtonX% %midButtonY%
ReturnPos()
BlockInput, MouseMoveOff
Return
//the right button on a pm (close)
p::
rightButtonX := A_ScreenWidth*0.5585
rightButtonY := A_ScreenHeight*0.6
BlockInput, MouseMove
CapPos()
Click %rightButtonX% %rightButtonY%
ReturnPos()
BlockInput, MouseMoveOff
Return
//used for food (hotkey slot Row 2, Column 7)
Lctrl::
BlockInput, MouseMove
CapPos()
HotkeyA()
Sleep 100
Click
ReturnPos()
BlockInput, MouseMoveOff
Return
//Used for hotkey items
1::
BlockInput, MouseMove
CapPos()
HotkeyA()
MoveToSlot(2,3)
Click
Sleep 150
Send d
ReturnPos()
BlockInput, MouseMoveOff
Return
2::
BlockInput, MouseMove
CapPos()
HotkeyA()
MoveToSlot(2,1)
Click
Sleep 150
Send d
ReturnPos()
BlockInput, MouseMoveOff
Return
3::
BlockInput, MouseMove
CapPos()
HotkeyB()
MoveToSlot(2,6)
Click
Sleep 10
Send s
ReturnPos()
BlockInput, MouseMoveOff
Return
4::
BlockInput, MouseMove
CapPos()
HotkeyB()
MoveToSlot(1,4)
Click
Sleep 10
Send s
ReturnPos()
BlockInput, MouseMoveOff
Return
5::
BlockInput, MouseMove
CapPos()
HotkeyA()
MoveToSlot(2,2)
Click
Sleep 10
Send d
ReturnPos()
BlockInput, MouseMoveOff
Return
c::
BlockInput, MouseMove
CapPos()
HotkeyA()
MoveToSlot(1,7)
Click
Sleep 10
Send d
ReturnPos()
BlockInput, MouseMoveOff
Return
v::
BlockInput, MouseMove
CapPos()
HotkeyB()
MoveToSlot(1,6)
Click
Sleep 10
Send s
ReturnPos()
BlockInput, MouseMoveOff
Return
//Clock button
t::
ifwinexist, clock
{
gui, destroy
return
}
ifwinnotexist, clock
{
//get the color of the window, and the position of the clock
PixelGetColor, CustomColor, A_ScreenWidth-2, A_ScreenHeight-61
TimePosX := A_ScreenWidth - 100
TimePosY := A_ScreenHeight - 122
Gui, +AlwaysOnTop +LastFound +ToolWindow // +ToolWindow avoids a taskbar button and an alt-tab menu item.
Gui, Color, %CustomColor% //set background color of the clock
Gui, Margin, 5, 45 //set margins to center the clock in the window
Gui, -Caption // Remove the title bar and window borders.
Gui, Font, s16,,Segoe WP //font size and type
Gui, Add, Text, vMyText cBlack, XXXXXXXXXXX // XX & YY serve to auto-size the window.
SetTimer, UpdateOSD, 1000 //update clock every second
Gosub, UpdateOSD // Make the first update immediate rather than waiting for the timer.
Gui, Show, W100 H150 x%TimePosX% y%TimePosY% NoActivate, clock // NoActivate avoids deactivating the currently active window.
return
UpdateOSD:
FormatTime, Time_a , h:m:s, h:mm tt
GuiControl,, MyText , %Time_a%
Gui, Color, %CustomColor%
return
}
//Exits EraAWSD
\::
MsgBox, Thank you for using EraAWSD! All hotkeys are now disabled.
ExitApp
//-----------the following below are methods for cleaning the code above----
//Opens the respective hotkey slots
HotkeyA(){
MouseClickDrag, L, equipX, equipY1, equipX-50, equipY1
}
HotkeyB(){
MouseClickDrag, L, equipX, equipY2, equipX-50, equipY2
}
//methods for capturing where your mouse was before a command, and returning it there after it executes
CapPos(){
MouseGetPos, neutralX, neutralY
}
ReturnPos(){
MouseMove, neutralX, neutralY
}
//when a hotkey is open, moves to the respective row and column as displayed on your menu
//This method assumes that you own all 15 hotkeys, may work differently otherwise
MoveToSlot(Row,Column){
if(Column != 7){
MouseMove, -41*(7-Mod(Column,7)),41*(Row-2),,R
} else {
MouseMove,0,41*(Row-2),,R
}
}
-Open your EraAWSD script in notepad or some other .txt editor (I use Notepad++)
-Scroll down to the key you want to edit and change the lines noted below as neeeded