Quantcast
Channel: Dolphin, the GameCube and Wii emulator - Forums - All Forums
Viewing all articles
Browse latest Browse all 26094

mouse camera control "script" thingy

$
0
0
hey guys im new here...

today i tried to find the best keyboard/mouse configuration for Monster Hunter try and the mouse response is very slow...
i found a topic on this forum about this issue but i can no longer find it...
meanwhile i tried and succeed to make a little script in auto-it that maps a certain button to the position of the cursor on the screen.
in other words if mouse is to the very edge of the screen it will trigger a button press and thus moving the camera (very similar to PC RTS camera control)
if whoever made that topic that i found back than still needs this and fits their need... ill attach the file here.

how to use
- it only works on 1680X1050 (but that can easily be adjusted)
- bound keys are u i o p(use this like in picture)
- activation keys are 6 7 8 9 (non numpad)
- keys 6 and 7 activates/deactivates the master (vertical axis not activated here)
- keys 8 and 9 activates/deactivates vertical axis(used in water battles in MH3 and will not run unless the master is active)

other notes.
a) its possible that it might not work for since one line of code in there makes it run only when the emulator screen is active(if class is not the same it will not work)
b) sometime its glitchy and i spams random buttons like caps lock or ctrl.. so if it freaks out , killing auto-it.exe procces seems to fix it
c) i had no previous experience with autoit so whatever other bugs it has,i cant help u too much.sorry Sad
d) the code is very basic and "dirty", perhaps someone could provide a more elegant aproach.

download and install auto it and then run this script

hope it helps someone Smile

Code:
#include <Misc.au3>

Local $hDLL = DllOpen("user32.dll")

#include <GUIConstantsEx.au3>

Opt("GUIOnEventMode", 1)
global $water
Global $run
Global $ExitID
$KeyToPress1 = "o"
$KeyToPress2 = "p"
$KeyToPress3 = "u"
$KeyToPress4 = "i"
_Main()

Func _Main()
    $water=0
    
    Local $YesID, $NoID

    GUICreate("Monster Hunter tri mouse binder", 210, 100)

    GUICtrlCreateLabel("6-activate", 10, 10)
    GUICtrlCreateLabel("7-deactivate", 10, 30)
    GUICtrlCreateLabel("8-activate water mode", 10, 50)
    GUICtrlCreateLabel("9-deactivate water mode", 10, 70)
    GUISetOnEvent($GUI_EVENT_CLOSE, "OnExit")

    GUISetState()
     while 1
       If _IsPressed("36",$hDLL) Then
           $run=1
           Beep(1000,100)
           Sleep(250)
       EndIf
    
       If _IsPressed("37", $hDLL) Then
           $run=0
           Beep(500,100)
           Sleep(250)
       EndIf
    
       If _IsPressed("38", $hDLL) Then
           $water=1
           Beep(1000,100)
           Sleep(250)
       EndIf
    
       If _IsPressed("39", $hDLL) Then
           $water=0
           Beep(500,100)
           Sleep(250)
       EndIf
    
       if WinActive("[CLASS:wxWindowNR]","") then
        
      
        if $run=1 Then
            Local $pos = MouseGetPos()
           if $water=1 Then
  
  
              if $pos[1]<100 then
                 Send ("{"&$KeyToPress3&" DOWN}")
              EndIf

              if $pos[1]>100 then
                 Send ("{"&$KeyToPress3&" UP}")
              EndIf

              if $pos[1]>1000 then
                Send ("{"&$KeyToPress4&" DOWN}")
              EndIf

              if $pos[1]<1000 then
                 Send ("{"&$KeyToPress4&" UP}")
              EndIf
              
         EndIf
  
              if $pos[0]<100 then
                 Send ("{"&$KeyToPress1&" DOWN}")
              EndIf

              if $pos[0]>100 then
                 Send ("{"&$KeyToPress1&" UP}")
              EndIf

              if $pos[0]>1500 then
                 Send ("{"&$KeyToPress2&" DOWN}")
              EndIf

              if $pos[0]<1500 then
                 Send ("{"&$KeyToPress2&" UP}")
             EndIf
        
    
          
         EndIf
        EndIf
     WEnd
    
EndFunc   ;==>_Main



Func OnExit()

    Exit
EndFunc   ;==>OnExit


.jpg  Mh3 controls.jpg (Size: 164.52 KB / Downloads: 10)

Viewing all articles
Browse latest Browse all 26094

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>