d2jsp
Log InRegister
d2jsp Forums > Other Games > Archived Games > Hellgate > Bot Creation...
Prev123456Next
Closed
Member
Posts: 15
Joined: Sep 30 2011
Gold: 0.00
Oct 16 2011 03:18pm
I can give you code to enter and leave the portal stonehedge with 100% success if you want.
Member
Posts: 2,187
Joined: Sep 3 2006
Gold: 16,500.02
Oct 16 2011 05:30pm
Quote (Kasad @ Oct 16 2011 04:18pm)
I can give you code to enter and leave the portal stonehedge with 100% success if you want.


Mine never fails now, but any suggestions would be awesome.
Also, I want to make the process run in the backround so i can use my PC for other things.

Here is the sample code to do it:
Code
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
WinSetState("Untitled - Notepad","",@SW_HIDE)
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
ControlSend("Untitled - Notepad","","","{CTRLDOWN}a{CTRLUP}Some{SPACE}text.")
sleep(2000)
MouseMove(491,408)
MouseDown("left")
MouseUp("left")
If Not WinActive("Untitled - Notepad","") Then WinActivate("Untitled - Notepad","")
WinSetState("Untitled - Notepad","",@SW_SHOW)


I need to change all of my Send to ControlSend, I'm sure.
I also want to clean up all of the multiple click loops and turn them into 1. I'm reading a lot about this right now, but if you can tell me, that would be awesome as well.

Also, I have a working Marksman Bot coming soon.

This post was edited by chumly on Oct 16 2011 05:31pm
Member
Posts: 9,601
Joined: Nov 27 2005
Gold: 5,000.00
Oct 16 2011 06:24pm
ive got a very basic version running just for the xp, i was running more complex back when they still have 8 hr dissassemblers for trade, but now that you can't trade them i don't think it is worth it to try for loot.

my main thing i want to change is that i want to be able to leave my bot running all day because im usually gone for 12+ hours. but either the channel will crash or my game will crash after a few hours, so I'm thinking I should maybe have the bot actually start hellgate and login, and then restart the program and re-log every hour or few... only problem would be the security code, would have to setup a pixel search, and probably just use the same digit all four times like 0000 or 1111... lmk what you guys think about that idea.
Member
Posts: 2,187
Joined: Sep 3 2006
Gold: 16,500.02
Oct 16 2011 06:56pm
Quote (sofakingdom @ Oct 16 2011 07:24pm)
ive got a very basic version running just for the xp, i was running more complex back when they still have 8 hr dissassemblers for trade, but now that you can't trade them i don't think it is worth it to try for loot.

my main thing i want to change is that i want to be able to leave my bot running all day because im usually gone for 12+ hours.  but either the channel will crash or my game will crash after a few hours, so I'm thinking I should maybe have the bot actually start hellgate and login, and then restart the program and re-log every hour or few... only problem would be the security code, would have to setup a pixel search, and probably just use the same digit all four times like 0000 or 1111... lmk what you guys think about that idea.


I was thinking about that as well. Right now, I'm more concerned about getting it to run minimized. I'm trying to work with a function call _MouseClickPlus, to no avail so far.

Here's my code so far for V2.0a, the mouse clicks are NOT working as of yet, I'm of half a mind to scrap all of that and use controlsend for all my keys, but I still need to reset the instance. ><

THIS CODE DOES NOT WORK
Code
;### Tidy Error: next line creates a negative tablevel.
;### Tidy Error: next line creates a negative tablevel for the line after it.
#ce ----------------------------------------------------------------------------

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

#region
$Form1 = GUICreate("Hellgate Bot", 268, 257, 637, 331)
$Form1 = GUISetBkColor(0xb83f5d)
$Form1 = GUICtrlSetFont(-1, 12, 800, 0, "Comic Sans Ms")
$Form1 = GUISetState()
$Button1 = GUICtrlCreateButton("START", 20, 40, 190, 50, 0)
$Button2 = GUICtrlCreateButton("Pause Button = Pause / ESC = Quit", 20, 120, 190, 50, 0)
$Button3 = GUICtrlCreateButton("USE 1024x768 RESOLUTION", 20, 180, 250, 50, 0)
GUISetState(@SW_SHOW)
$Mouse = MouseGetPos()
#endregion

_WinWaitActivate("Hellgate (x86 DX9)", "")
Global $Paused
HotKeySet("{PAUSE}", "TogglePause")
HotKeySet("{ESC}", "Terminate")

Opt("MouseCoordMode", 0)

Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc

Func _move($loop, $key)
For $i = $loop To 1 Step -1
ControlSend("Hellgate (x86 DX9)", "", "", $key)
Next
EndFunc ;==>_move

Func TogglePause()
  $Paused = NOT $Paused
  While $Paused
      sleep(100)
      ToolTip('BOT IS PAUSED ATM',0,0)
  WEnd
  ToolTip("Use 1024x768")
EndFunc

Func Terminate()
  Exit 0
EndFunc

Func _MouseClickPlus($Window, $Button = "left", $X = "", $Y = "", $Clicks = 1)
   Local $MK_LBUTTON       =  0x0001
   Local $WM_LBUTTONDOWN   =  0x0201
   Local $WM_LBUTTONUP     =  0x0202
   
   Local $MK_RBUTTON       =  0x0002  
   Local $WM_RBUTTONDOWN   =  0x0204
   Local $WM_RBUTTONUP     =  0x0205

   Local $WM_MOUSEMOVE     =  0x0200
   
   Local $i                = 0
   
   Select
   Case $Button = "left"
      $Button     =  $MK_LBUTTON
      $ButtonDown =  $WM_LBUTTONDOWN
      $ButtonUp   =  $WM_LBUTTONUP
   Case $Button = "right"
      $Button     =  $MK_RBUTTON
      $ButtonDown =  $WM_RBUTTONDOWN
      $ButtonUp   =  $WM_RBUTTONUP
   EndSelect
   
   If $X = "" OR $Y = "" Then
      $MouseCoord = MouseGetPos()
      $X = $MouseCoord[0]
      $Y = $MouseCoord[1]
   EndIf
   
   For $i = 1 to $Clicks
      DllCall("user32.dll", "int", "SendMessage", _
         "hwnd",  WinGetHandle( $Window ), _
         "int",   $WM_MOUSEMOVE, _
         "int",   0, _
         "long",  _MakeLong($X, $Y))
         
      DllCall("user32.dll", "int", "SendMessage", _
         "hwnd",  WinGetHandle( $Window ), _
         "int",   $ButtonDown, _
         "int",   $Button, _
         "long",  _MakeLong($X, $Y))
         
      DllCall("user32.dll", "int", "SendMessage", _
         "hwnd",  WinGetHandle( $Window ), _
         "int",   $ButtonUp, _
         "int",   $Button, _
         "long",  _MakeLong($X, $Y))
   Next
EndFunc

Func _MakeLong($LoWord,$HiWord)
   Return BitOR($HiWord * 0x10000, BitAND($LoWord, 0xFFFF))
EndFunc

While 1
$nMsg = GUIGetMsg()

Select

Case $Button1
 While 1

  Sleep(3000); TO PORTAL  
ControlSend("Hellgate (x86 DX9)", "", "", "{s down}")
  Sleep(1200)
ControlSend("Hellgate (x86 DX9)", "", "", "{s up}")
  Sleep(200)
ControlSend("Hellgate (x86 DX9)", "", "", "{w down}")
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{w up}")
  Sleep(200)
ControlSend("Hellgate (x86 DX9)", "", "", "{s down}")
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{s up}")
  Sleep(5)
  _move(20, "w")
  Sleep(5)
  _move(20, "s")
  Sleep(6000); INSIDE BELOW THIS LINE
  _move(50, "w")
  Sleep(5)
  _move(60, "a")
  _move(60, "w")
  Sleep(10)
  _move(40, "a")
  Sleep(10)
  _move(60, "w")
  Sleep(10)
  _move(30, "a")
  Sleep(10)
  _move(120, "w")
  Sleep(10)
  _move(60, "a")
  Sleep(10)
  _move(100, "w")
  Sleep(10)
  _move(30, "a")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "right"); Hellfire
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left"); Demonspine
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
  Sleep(1000)
  _move(20, "w")
  Sleep(500)
_MouseClickPlus("Hellgate (x86 DX9)", "right")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "right")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "right")
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left")
  Sleep(1000)  
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{8}")
  Sleep(1000)
ControlSend("Hellgate (x86 DX9)", "", "", "{ENTER}")
  Sleep(500)
ControlSend("Hellgate (x86 DX9)", "", "", "/unstuck")
  Sleep(500)
ControlSend("Hellgate (x86 DX9)", "", "", "{ENTER}")
  Sleep(12000)
ControlSend("Hellgate (x86 DX9)", "", "", "{7}")
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f down}"); Loot
  Sleep(150)
ControlSend("Hellgate (x86 DX9)", "", "", "{f up}")
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{s down}")
  Sleep(1200)
ControlSend("Hellgate (x86 DX9)", "", "", "{s up}")
  Sleep(200)
ControlSend("Hellgate (x86 DX9)", "", "", "{w down}")
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{w up}")
  Sleep(200)
ControlSend("Hellgate (x86 DX9)", "", "", "{s down}")
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{s up}")
  Sleep(5)
  _move(20, "w")
  Sleep(5)
  _move(20, "s")
  Sleep(6000)
ControlSend("Hellgate (x86 DX9)", "", "", "{ALTDOWN}"); RESET
  Sleep(1000)
_MouseClickPlus("Hellgate (x86 DX9)", "left", "831", "41", 10)
  Sleep(2000)
_MouseClickPlus("Hellgate (x86 DX9)", "left", "442", "404", 10)
  Sleep(2000)
_MouseClickPlus("Hellgate (x86 DX9)", "left", "505", "388", 10)
  Sleep(250)
ControlSend("Hellgate (x86 DX9)", "", "", "{ALTUP}")
  Sleep(250)

 WEnd

Case $Button2
 GUIDelete()
 ExitLoop

EndSelect


WEnd
Member
Posts: 9,601
Joined: Nov 27 2005
Gold: 5,000.00
Oct 16 2011 07:31pm
have you been posting on autoit forums? i never knew how to send clicks to minimized window

edit: or if you got a nice comp, you can run it in a vmware

This post was edited by sofakingdom on Oct 16 2011 07:32pm
Member
Posts: 2,187
Joined: Sep 3 2006
Gold: 16,500.02
Oct 16 2011 08:42pm
Quote (sofakingdom @ Oct 16 2011 08:31pm)
have you been posting on autoit forums? i never knew how to send clicks to minimized window

edit: or if you got a nice comp, you can run it in a vmware


It's been a long time since I checked out their forums... apparently you can't utilize the program anymore for the only thing it's good at. lol. #fail
Member
Posts: 9,601
Joined: Nov 27 2005
Gold: 5,000.00
Oct 16 2011 11:01pm
Quote (chumly @ Oct 16 2011 10:42pm)
It's been a long time since I checked out their forums...  apparently you can't utilize the program anymore for the only thing it's good at.  lol. #fail


thats y you choose your words carefully ;)

or you just ask how to do the clicking or w/e you need to learn, you don't show it is a bot
Member
Posts: 4,047
Joined: Dec 30 2006
Gold: 3.36
Warn: 10%
Oct 17 2011 04:01am
When can we get exe ver?
Member
Posts: 15
Joined: Sep 30 2011
Gold: 0.00
Oct 17 2011 12:29pm
I was searching the controlclick for days,until I realised,you need to know the button in order to make the minimized click.

In sort,the system does not use mouse itself ,but it identifies the button and sends a click directly to it.
Member
Posts: 2,187
Joined: Sep 3 2006
Gold: 16,500.02
Oct 17 2011 01:01pm
Quote (Kasad @ Oct 17 2011 01:29pm)
I was searching the controlclick for days,until I realised,you need to know the button in order to make the minimized click.

In sort,the system does not use mouse itself ,but it identifies the button and sends a click directly to it.


So... coordinates are out of the question?

And I would like your portal entrance code. Mine has a tendency to fail from time to time I've noticed. ><
Go Back To Hellgate Topic List
Prev123456Next
Closed