Deprecated: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in /home/iano/public_html/tpforums-vb5/forum/includes/class_core.php on line 5842

PHP Warning: Use of undefined constant MYSQL_NUM - assumed 'MYSQL_NUM' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_ASSOC - assumed 'MYSQL_ASSOC' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: Use of undefined constant MYSQL_BOTH - assumed 'MYSQL_BOTH' (this will throw an Error in a future version of PHP) in ..../includes/init.php on line 165

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 588

PHP Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in ..../includes/functions_navigation.php on line 612

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../global.php(29) : eval()'d code(6) : eval()'d code on line 1

PHP Warning: Use of undefined constant misc - assumed 'misc' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant index - assumed 'index' (this will throw an Error in a future version of PHP) in ..../includes/class_bootstrap.php(1422) : eval()'d code(4) : eval()'d code on line 1

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6

PHP Warning: Use of undefined constant onlinestatusphrase - assumed 'onlinestatusphrase' (this will throw an Error in a future version of PHP) in ..../includes/class_core.php(4684) : eval()'d code on line 6
C# How to use mouse click
Results 1 to 6 of 6

Thread: C# How to use mouse click

  1. #1
    Junior Member
    Join Date
    Jan 2015
    Posts
    27

    C# How to use mouse click

    How to use mouse click for walking in X,Y,Z position or use another method for walking
    i can get the position of my character, and send the position to listbox1, but the walking no, somebody help me ?

    and i have one question about the tibiasock.dll or tibiapacket.dll, if new update of tibia, i need update the dll too?

  2. #2

  3. #3
    Junior Member
    Join Date
    Jan 2015
    Posts
    27
    i don't like delphi, but i try convert code of source to C#, i back when get results

  4. #4
    Senior Member
    Join Date
    Dec 2011
    Posts
    249
    Writing the goto values would probably be easiest to begin with. And yes you will most of the times atleast update the addresses of them. In some updates you might need to fix other things aswell

  5. #5
    Code:
    Public Function LocToPosition(ByVal x As Integer, ByVal y As Integer) As Point
            Dim playerLoc As New Point(GetPlayer.X, GetPlayer.Y)
            Dim tileSize As Double = 28 'its the size of sqm
            Dim centerscreen As New Point(588, 297) 'its the player center screen position
            Dim xDiff As Integer = x - playerLoc.X
            Dim yDiff As Integer = y - playerLoc.Y
            Return New Point(centerscreen.X + (xDiff * tileSize), centerscreen.Y + (yDiff * tileSize))
    End Function
    Code:
        Public Sub Click(ByVal Location As Point)
            Dim lnglParam As String = (Location.Y * &H10000) + Location.X
            SendMessage(Tibia.MainWindowHandle, WM_LBUTTONDOWN, 1&, lnglParam)
            SendMessage(Tibia.MainWindowHandle, WM_LBUTTONUP, 1&, lnglParam)
        End Sub
    Code:
    Public Function Walk(ByVal x As Integer, ByVal y As Integer, ByVal z As Integer)
            Dim s As Point = New Point(LocToPosition(x, y))
            Input.Click(s)
    End Function
    Code:
        <DllImport("user32.dll")> _
        Public Function SendMessage(ByVal hWnd As IntPtr, ByVal Msg As UInteger, ByVal wParam As Integer, ByVal lParam As Integer) As IntPtr
        End Function
    
    
        Public Const WM_LBUTTONDOWN As UInteger = &H201
        Public Const WM_LBUTTONUP As UInteger = &H202
    Thanks to TibiaAPI and to Klusbert. Enjoy it!!!

    Use http://www.developerfusion.com/tools.../vb-to-csharp/ to convert the code.
    Last edited by JulinhoPiuPiu; 01-24-2015 at 07:13 PM. Reason: Code converter

  6. #6
    Junior Member
    Join Date
    Jan 2015
    Posts
    27
    i try making bot, or update the neoclone bot, but i have big problems D=

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •