Stop turining when rotation is correct? menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 16
  1. #1
    ashleyww's Avatar Banned
    Reputation
    6
    Join Date
    Apr 2009
    Posts
    131
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Stop turining when rotation is correct?

    Here is my code(Yes,yes again it Autoit)

    I cant get it to stop when its close to(or exact at rotation

    Code:
    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <NomadMemory.au3>
    
    
    HotKeySet("{f5}", "_exit")
    
    ;settings -----------------
    $Playerbase = 0x010BD5F4
    $Off1=0x34
    $Off2=0x24
    $Playerrotation = 0x7A8
    
    
    SETPRIVILEGE("SeDebugPrivilege", 1)
    Dim $ProPID = WinGetProcess("World of Warcraft")
    $wowprocess = _MemoryOpen($ProPID)
    
    
    #Region ### START Koda GUI section ### Form=
    $MainGUI = GUICreate("Move rot", 235, 129)
    WinSetTrans($MainGUI, 0, 170)
    $plrrot = GUICtrlCreateLabel("Current rotation:", 8, 8, 200, 17)
    $Group1 = GUICtrlCreateGroup("Move rotation to:", 8, 32, 217, 49)
    $moveto = GUICtrlCreateInput("3", 16, 48, 201, 21)
    GUICtrlCreateGroup("", -99, -99, 1, 1)
    $pointerbut = GUICtrlCreateButton("Get Rotation", 8, 88, 75, 25, 0)
    $move = GUICtrlCreateButton("Move", 152, 88, 75, 25, 0)
    *****tState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###
    WinSetOnTop("Move rot", "", 1)
    While 1
    	$nMsg = GUIGetMsg()
    	Switch $nMsg
    		Case $GUI_EVENT_CLOSE
    			Exit
    		Case $move
    			WinActivate("World of Warcraft")
    			Sleep(2000)
    			_move()
    EndSwitch
    	_getpointers()
    WEnd
    
    
    Func _move()
    $readinput = GUICtrlRead($moveto)
    			
    Do
    Send("{Left down}{Left up}")
    sleep(Random(20,40))
    _getpointers()
    sleep(Random(20,40))
    Until GUICtrlRead($plrrot) <= $readinput-0.4 And GUICtrlRead($plrrot) >= $readinput+0.4
    ;Until GUICtrlRead($plrrot) = $readinput
    EndFunc
    
    Func _Getpointers()
    	Global $LVL1POINTER = _MemoryRead($Playerbase, $wowprocess, "ptr")
        Global $LVL2POINTER = _MemoryRead(($LVL1POINTER + $Off1), $wowprocess, "ptr")
        Global $PlayerMEM = _MemoryRead(($LVL2POINTER + $Off2), $wowprocess, "ptr")
    	Global $Rotationread = $PlayerMEM + $Playerrotation
    	
    If GUICtrlRead($plrrot) = "Current Rotation: " & _MEMORYREAD($Rotationread, $wowprocess, "float") Then
    	Sleep(10)
    Else
    	Update()
    EndIf
    
    EndFunc
    
    
    Func Update()
    GUICtrlSetData($plrrot, "Current Rotation: " & _MEMORYREAD($Rotationread, $wowprocess, "float"))
    EndFunc
    
    Func _exit()
    Exit
    EndFunc

    Anyideas

    Stop turining when rotation is correct?
  2. #2
    Froogle's Avatar Legendary
    Reputation
    690
    Join Date
    Jan 2007
    Posts
    787
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Until GUICtrlRead($plrrot) <= $readinput-0.4 And GUICtrlRead($plrrot) >= $readinput+0.4

    Pretty sure that should be a or statement, not an and statement...

    As if you graphed those two statements it would look like

    <---------(x-0.4)~~~~~~~~~~~(x+0.4)-------->

    If you know what that is then you'll know that both conditions will NEVER be met, so an AND statement will not work.


  3. #3
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Make sure you're converting it to degrees/radians depending on what you're using for input.

  4. #4
    ashleyww's Avatar Banned
    Reputation
    6
    Join Date
    Apr 2009
    Posts
    131
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    huh? how can it never b?

  5. #5
    Froogle's Avatar Legendary
    Reputation
    690
    Join Date
    Jan 2007
    Posts
    787
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ok.... lets say that you're turning and have gotten your angle to 3.9 and the angle you wanted to get to was 4.0, with your idea the bot would stop turning, but...

    $plrrot <= $readinput-0.4 And $plrrot >= $readinput+0.4

    Plugging in...

    3.9 <= 4.0-0.4 AND 3.9 >= 4.0+0.4
    3.9 <= 3.6 AND 3.9 >= 4.4

    First condition is false, 2nd condition is false.


    As it is an AND statement, the loop will continue to run as it requires BOTH (or all) conditions to be met.

    Obviously neither conditions were meant, which they should've with your thinking...? ffff
    Last edited by Froogle; 06-06-2009 at 06:09 PM.


  6. #6
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just try your Until statement with an OR instead. What he's saying is that it can't be <.4+input and >.4+input at the same time. impossible.

  7. #7
    Froogle's Avatar Legendary
    Reputation
    690
    Join Date
    Jan 2007
    Posts
    787
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just switching to an OR statement will not work either...

    Actually looking at it you could use an AND statement if you changed it to....


    $plrrot >= $readinput-0.4 And $plrrot <= $readinput+0.4


    Your method is still flawed though as there's +/- 0.4 radians for error, being 0.8 radians... 0.8 radians = ~46 degrees.





    On a side note... why don't you just make a write to rotation? The time delay of key turning will cause a lot of problems later, like spinning randomly, spinning around a point, etc.
    Last edited by Froogle; 06-06-2009 at 06:19 PM.


  8. #8
    lanman92's Avatar Active Member
    Reputation
    50
    Join Date
    Mar 2007
    Posts
    1,033
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Probably afraid of injection :P

    EDIT: the reason I was wrong just now was because I didn't look very hard at her code.

  9. #9
    Jadd's Avatar 🐸 Premium Seller
    Reputation
    1511
    Join Date
    May 2008
    Posts
    2,433
    Thanks G/R
    81/333
    Trade Feedback
    1 (100%)
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Well you could always write to the rotation... If you wanna send keystrokes though, this will help.

    Code:
    Func _Move()
    	Do Until Round($Rotation, 4) = Round($RotationRead, 4) ;I used the Round function since the Rotation amount is normally to about 20 decimal places. If we didn't round it chances are it would turn forever.
    		$Rotation = _MemoryRead($RotationRead, $WoW, 'Float')
    
    		SendKeys('{Left Down}')
    	Next
    	
    	SendKeys('{Left Up}')
    EndFunc
    I'm not on a computer with AutoIt at the moment and cbf to change computers to check syntax... It's probably all right though.
    Last edited by Jadd; 06-06-2009 at 10:05 PM.

  10. #10
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    typedef void ( __thiscall * tSetFacing)(void* lp, float* angle);
    tSetFacing oSetFacing = reinterpret_cast<tSetFacing>(0x005AF810);

    DWORD_PTR dwLocalPlayer = *reinterpret_cast<DWORD_PTR*>(*reinterpret_cast<DWORD_PTR*>(*reinterpret_cast<DW ORD_PTR*>(0x10BD5F4) + 0x34) + 0x24);

    oSetFacing(reinterpret_cast<void*>(dwLocalPlayer), pAngle);
    U can do it like this too.

  11. #11
    ashleyww's Avatar Banned
    Reputation
    6
    Join Date
    Apr 2009
    Posts
    131
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I decided to use injection... its Quicker....


    Thanks for everyones help tho.

  12. #12
    kynox's Avatar Account not activated by Email
    Reputation
    830
    Join Date
    Dec 2006
    Posts
    888
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Nesox View Post
    U can do it like this too.
    Why do you not take advantage of the fact that you're injected and call ClntObjMgrGetObjectPtr on your local players GUID?

    Hell, theres even a GetLocalPlayerPtr()

  13. #13
    Cypher's Avatar Kynox's Sister's Pimp
    Reputation
    1356
    Join Date
    Apr 2006
    Posts
    5,368
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kynox View Post
    Why do you not take advantage of the fact that you're injected and call ClntObjMgrGetObjectPtr on your local players GUID?

    Hell, theres even a GetLocalPlayerPtr()

    Nigga that be crazy talk.

  14. #14
    Nesox's Avatar ★ Elder ★
    Reputation
    1280
    Join Date
    Mar 2007
    Posts
    1,238
    Thanks G/R
    0/3
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by kynox View Post
    Why do you not take advantage of the fact that you're injected and call ClntObjMgrGetObjectPtr on your local players GUID?

    Hell, theres even a GetLocalPlayerPtr()

    Yea i guess.
    Or you could call GetActivePlayer()->GetObjectByGUID() to get it
    :devildance:

  15. #15
    suicidity's Avatar Contributor
    Reputation
    207
    Join Date
    Oct 2006
    Posts
    1,439
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Cypher View Post

    Dark colored man that be crazy talk.
    Mission completed.


Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 7
    Last Post: 09-13-2011, 11:36 AM
  2. Noggit stops responding when I start it up
    By Stany8 in forum WoW ME Questions and Requests
    Replies: 3
    Last Post: 12-05-2010, 08:44 AM
  3. [Resolved] How to stop Object Manager in the correct spot
    By Jadd in forum WoW Memory Editing
    Replies: 10
    Last Post: 11-16-2009, 06:44 AM
All times are GMT -5. The time now is 07:16 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search