Sign in to follow this  
Followers 0
Kimo

Could someone help with this easy script please

9 posts in this topic

Hi, Im looking to make a script for Diablo II for weapon switch glitch.

This involves hitting w then q in game one after eachother quickly.

Could anyone help please?

Share this post


Link to post
Share on other sites



Kimo,

The simple answer is NO!

It is against forum rules to discuss game automation and this topic comes up repeatedly. You should have looked before posting lest incur the wrath of the mod's.

Look here: http://www.autoitscript.com/forum/forum-2/announcement-13-forum-rules/

Share this post


Link to post
Share on other sites

Thanks for the quick response, it isnt a cheat or change, my w key is worn out and I have no other keys to bind so I was going to use this instead.

Share this post


Link to post
Share on other sites

Buy another keyboard or Valik will come a knockin'!

Share this post


Link to post
Share on other sites

Thanks for the quick response, it isnt a cheat or change, my w key is worn out and I have no other keys to bind so I was going to use this instead.

ahh :mellow: best self-preservation i ve ever seen :)


:alien: ~ Every Living Thing is a Code Snippet of World Application ~ :alien:

Share this post


Link to post
Share on other sites

#6 ·  Posted (edited)

#include <Misc.au3>
While 1
    If Not (_IsPressed(87H) = 0) Then Send("{Asc 0x057}")
WEnd

W is now bound to F24. Have fun. This script can not be changed or else it won't work.

EDIT: IMPROVED Performance

EDIT: Bounded W to F24 for easier access

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Anyone have any other ideas on how to IMPROVE my scripts' performance. I was thinking making it do math like While 2+2 = 1+3.

Edited by rcmaehl

My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
Share on other sites

Hi,

I used the example from _WinAPI_SetWindowsHookEx and modified it.

Good (maybe bad) is that it suppresses the key your pressing from being sent with the send key.

I did a similar thing for myself and the game Dead Space.

The game was hard set to w/a/s/d and wouldn't let me assign up/down/left/right keys for movement.

#include <WindowsConstants.au3>
#include <StructureConstants.au3>
#include <WinAPI.au3>

OnAutoItExitRegister("_Cleanup")

Global $sInKey = "Q", $sOutKey = "w"
Global $hKeyProc, $hHook, $iQuit

$hKeyProc = DllCallbackRegister("_KeyProc", "long", "int;wparam;lparam")
$hHook = _WinAPI_SetWindowsHookEx($WH_KEYBOARD_LL, DllCallbackGetPtr($hKeyProc), _WinAPI_GetModuleHandle(0))

While Not $iQuit
    Sleep(10)
WEnd

Func _KeyProc($nCode, $wParam, $lParam)
    Local $tKEYHOOKS = DllStructCreate($tagKBDLLHOOKSTRUCT, $lParam)
    If $nCode < 0 Then Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)

    If $wParam = $WM_KEYDOWN Then
        Switch DllStructGetData($tKEYHOOKS, "vkCode")
            Case Asc($sInKey)
                Send($sOutKey)
                Return 1
            Case 27 ; Esc key
                $iQuit = 1
        EndSwitch
    EndIf
    Return _WinAPI_CallNextHookEx($hHook, $nCode, $wParam, $lParam)
EndFunc   ;==>_KeyProc

Func _Cleanup()
    If $hHook Then _WinAPI_UnhookWindowsHookEx($hHook)
    If $hKeyProc Then DllCallbackFree($hKeyProc)
EndFunc   ;==>Cleanup

Cheers

Share this post


Link to post
Share on other sites

*FACEPALM*


My UDFs are generally for me. If they aren't updated for a while, it means I'm not using them myself. As soon as I start using them again, they'll get updated.

MY PROJECTS


Active: IRC UDF, WindowEx UDF
Discontinued: GithubBubbleSort UDF

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0