Instructions: http://badplayerr.github.io/
Instructions: http://badplayerr.github.io/
Last edited by gurud; 10-22-2015 at 08:27 PM. Reason: UPDATED 10/07/2015
Nice Job! Thank you
Awesome work as always, Gurud.
Gurud is king :P
I Personally use a more simple just Quaff & DC script but it was based off of a mixture of the old autoflask script and the information Gurud helped me obtain :P Thanks again gurud!
Hi Gurud, thanks for fixing this up, i do have a few questions though. In the previous script the f2 cmd gave me the mouse coordinates of the mouse, however in this script the feature does not seem to be in there. How would i add this feature back in, since it would be useful for finding the coordinates for the portal or other cases.
On the script i changed the Portal cmd key to F5, also i have my inventory button set to ` instead of I, what i would like to know is, when i am out in the field, do i need to have my inventory open before i hit F5 for this to work? I already remapped the mouse coordinates to my stack of portals it is the very first item slot in the top left corner of the inventory; however, whenever i press F5 with my inventory closed, it will just cast one of my skills, if i press F5 with my inventory open it will open up the portal, but instead of running through the portal the character will run a few steps to the right, how would i configure it, so that it clicks on the exact spot that i just opened the portal?.
The character selection exit is working perfectly so far.
As you can see in the script, i'm first sending the Space key, with closes all open windows including inventory, then pressing "i" to open it, if you changed those keys you would have to also changed in the script.
I'm working hard to solve that problem, but not yet achieved what i want, my idea is to use GetPixelColor to find the blue color of the portal or the name and click on it.
What resolution are you running?
I am running it at 1680x1050.
Also yes, i changed the button that closes all windows to the F key, since i use the space bar button to highlight/pickup items.
Would you happen to know how to add in the feature that gives us the mouse coordinates using the F2 button again. I tried transferring some of the old code from wrongusernames script, but failed to get it to work.
This is what i changed for the portal part, but i am still unable to get it working properly. There is also conflict with f5 if you use the zoom/fullbright hack, so now i know why you probably didn't go with f5
Send {SPACE 2}
Send {I 1}
loop ;only use portals when not moving
when i use this code above in the open field whether inventory window is open or closed, it will close inventory open the tp and run to the right.
changed to
Send {f 2}
Send {` 1}
loop ;only use portals when not moving
when i fixed up UI to use f to close windows and ` to open inventory, in open field it just shoots and i can see the mouse cursor moving to the desired portal coordinates and than quickly comes back to the center. If i have inventory open it will close the window, it does move the mouse cursor over to the scroll quickly, but never manages to open the tp and than recenter the cursor and the character does not move to the right.
Also what does the number 2 and 1 represent?
Also agree with you, if you can get GetPixelColor to detect the colour of the portal that would probably be the most effective way of getting this portal feature working, since some people might disable the name highlight feature.
I used the Fractional coords to get my my mouse coordinates for the portal scrolls and it seemed to work.
The numbers after the key to send designate how many times it's sent.
I'm not exactly sure why it's making the character run to the right.It is for me as well.
This;
does exactly the same thing as what you have but it works.Code:SetDefaultMouseSpeed, 0 F2:: BlockInput On Send {SPACE} sleep, 50 send i sleep, 50 MOuseclick, right, 1823, 823 ; scrollposition sleep, 50 Send {SPACE} sleep, 50 MouseClick, left, A_ScreenWidth/2, A_ScreenHeight/2 BlockInput Off return
You really shouldn't have to search for the portal at all though as your character is always dead center and the portal opens up behind them. Unless you're moving I guess.
I Updated the Script on the first page for the one i have now, i fixed many bugs i guess so try it out.
Don't forget to change Space and i, I also added a click with Move Only (default on T) so if you are moving it stops moving your hero.
Tell me the results, and if you get stuck just use ctrl + alt + del and it will unstuck the keys.
The 2 and 1 represented how muth times it clicked the key, i took it off now.
The PixelSearch is now finding The portal name, BUT also finds the Waypoint name and Chests names, so if you are near a chest or waypoint might not find the correct one.
I'll try to improve this tomorrow.
Also added the /oos command to prevent desync, (so the portal doesn't open too muth away from us)
The fractional coord you were getting on the old script was actually the window coord, because the offsets of fractional were wrong...
Fractional is pretty useless don't know why wrongusername put it in :/
Last edited by gurud; 12-10-2013 at 08:40 PM.
Yes, unless you are moving, or desync, the point is, i'm not writing this to use it as a hotkey, if i were a simple code like yours would do.
I'm trying to write a Use Portal script that could potentially be used as an autoquit method so when your about to die, just automatically get out in a portal, without losing progress.
And for that i need to assume the character will be moving, desync, attacking, using skills, etc.
I no longer see the code where i need to change the space button in the script, i have tested out the new script and see what you mean, when it gets confused with he waypoint or chest in the map area, perhaps it would work better if you set it to detect the colour of the portal? or would that not work very well with the swirls spinning within the portal changing up the colours. Another reason i think colour might be better is because not everyone plays with those highlights on however, if you decide to stick with the wording, perhaps u can limit the search area to search for the words above the portal only?
When tested in the open field under your settings it worked for both inventory open/closed. (Sometimes it was effected by waypoint or chest in the area, but worked pretty well)
Under my settings ` = inventory in the open field it would not work if if there was no inventory up. If inventory was open, it does work from time to time, but seems to have more trouble with detecting the portal words as it seems to detect the waypoint more often. It also seems to have slightly different effects if i have the highlight option enabled or disabled.
Here is the part i changed
Send {`}
MouseMove, 1070, 600
;Change the line above to the coord (x,y) of portal scrolls on inventory relative to the window,
;to see the coord right click on the script tray icon and select Window Spy
Last edited by ReadyToKill; 12-10-2013 at 10:27 PM.
how it work? when i run put this code in AutoHotkey and run script, it shows only error when trying to start...:confused:
you need AutoHotkeyMemoryLib.ahk, in the same folder as this script.
AutoHotkeyMemoryLib.ahk
Code:if (A_PtrSize != 4) { MsgBox, You are not running 32-bit version of Autohotkey L, reinstall correct version. Script will now terminate. ExitApp } GetModuleInfo(ModuleName, PID, byRef mBase="", byRef mSize="") { TH32CS_SNAPMODULE := 0x00000008 INVALID_HANDLE_VALUE = -1 VarSetCapacity(me32, 548, 0) NumPut(548, me32) snapMod := DllCall("CreateToolhelp32Snapshot", "Uint", TH32CS_SNAPMODULE, "Uint", PID) If (snapMod = INVALID_HANDLE_VALUE) { Return 0 } If (DllCall("Module32First", "Uint", snapMod, "Uint", &me32)){ If StrGet(&me32 + 32, "cp0")=ModuleName { mBase:=NumGet(&me32 + 20) mSize:=NumGet(&me32 + 24) DllCall("CloseHandle", "UInt", snapMod) Return } while(DllCall("Module32Next", "Uint", snapMod, "UInt", &me32)) { If StrGet(&me32 + 32, "cp0")=ModuleName { mBase:=NumGet(&me32 + 20) mSize:=NumGet(&me32 + 24) DllCall("CloseHandle", "UInt", snapMod) Return } } } DllCall("CloseHandle", "Uint", snapMod) } GetProcessHandle(pid) { return DllCall("OpenProcess", "UInt", 0x8|0x10|0x20, "UInt", 0, "UInt", pid, "UInt") } ReadMemFloat(ProcessHandle, MADDRESS) { if DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Float*",MVALUE,"UInt",4,"UInt*",0)!=0 { return MVALUE } } ReadMemUInt(ProcessHandle, MADDRESS) { if DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"UInt*",MVALUE,"UInt",4,"UInt*",0)!=0 { return MVALUE } } ReadMemSInt(ProcessHandle, MADDRESS) { if DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Int*",MVALUE,"UInt",4,"UInt*",0)!=0 { return MVALUE } } WriteMemUInt(ProcessHandle, MADDRESS, val) { DllCall("WriteProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"UInt*",val,"UInt",4,"UInt*",0)!=0 } WriteMemSInt(ProcessHandle, MADDRESS, val) { DllCall("WriteProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Int*",val,"UInt",4,"UInt*",0)!=0 } WriteMemFloat(ProcessHandle, MADDRESS, val) { DllCall("WriteProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"Float*",val,"UInt",4,"UInt*",0)!=0 } ReadMemStr(ProcessHandle, MADDRESS, maxlen=255, cp="cp0") { VarSetCapacity(MVALUE,maxlen) if DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",MADDRESS,"PTR",&MVALUE,"UInt",maxlen,"UInt*",bytesread)!=0 { Str:=StrGet(&MVALUE,cp) VarSetCapacity(MVALUE,0) return Str } VarSetCapacity(MVALUE,0) } GetMultilevelPointer(ProcessHandle, PARRAY) { if PARRAY._MaxIndex()<2 return if (DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",PARRAY[1],"UInt*",currOffset,"UInt",4,"UInt*",0)!=0) { i:=2 while (i<=PARRAY._MaxIndex() && DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",currOffset+PARRAY[i],"UInt*",currOffset,"UInt",4,"UInt*",0)!=0) { i:=i+1 } if (i>PARRAY._MaxIndex()) { return currOffset } } } AobScan(ProcessHandle,mBase,mSize, ByRef patternArray) { if (patternArray._MaxIndex()>mSize) { MsgBox, aobscan fail : pattern array is larger than module size return } VarSetCapacity(ClientCodeSegment,mSize) if (DllCall("ReadProcessMemory","UInt",ProcessHandle,"UInt",mBase,"PTR",&ClientCodeSegment,"UInt",mSize,"UInt*",bytesread)!=0) { pLen:=patternArray._MaxIndex() if (bytesread<>mSize) { VarSetCapacity(ClientCodeSegment,0) MsgBox, aobscan fail : mSize=%mSize% bytesread=%bytesread% return } i:=0 while (i<=mSize-pLen-1) { j:=1 while (j<=pLen) { if (patternArray[j]="?" || NumGet(ClientCodeSegment, i+j-1, "UChar")=patternArray[j]) { j:=j+1 } else { break } } if (j>pLen) { VarSetCapacity(ClientCodeSegment,0) return i } i:=i+1 } } MsgBox, aobscan fail : pattern not found VarSetCapacity(ClientCodeSegment,0) }