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 archive_postsperpage - assumed 'archive_postsperpage' (this will throw an Error in a future version of PHP) in ..../archive/index.php on line 456
C# How to use mouse click [Archive] - Forums

PDA

View Full Version : C# How to use mouse click



sleepy22
01-24-2015, 01:55 PM
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?

oclipper
01-24-2015, 02:10 PM
its delphi but maybe it worth

https://www.youtube.com/watch?v=GLr9gi_gifc
http://balfprogramador.blogspot.com.br/2014/12/link-novo-walker-sem-tibia-api.html

sleepy22
01-24-2015, 06:38 PM
i don't like delphi, but i try convert code of source to C#, i back when get results

ottizy
01-24-2015, 07:04 PM
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

JulinhoPiuPiu
01-24-2015, 07:10 PM
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




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




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




<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/convert/vb-to-csharp/ to convert the code.

sleepy22
01-27-2015, 06:44 PM
i try making bot, or update the neoclone bot, but i have big problems D=