Jump to content

Recommended Posts

Posted

Hey guys,

this is my first post and my first try of "coding". I learned something from videos etc. to develop a level bot for an old MMORPG. I`m using some Pixelsearch functions in the script.

The part: Tab_Mob_Attack_Mob_Using_Skills () -- works till the line  "while ($needRest)
 ;Do we get attacked by another Mob? - means that we can't rest"
I tried to implement this function in the part before (I did not know how, so maybe there is bug/mistake?)

The Func Check_If_Dead () also doesn't work -- The Mouse does not move or click at the position (or at all); Maybe Function is also in the wrong position?..

I hope somebody could help me, would be really glad;) Im a newbie, so I gave my best.. Maybe you could have a look at it. If you need more Information, ask me😊

while(1)
   Tab_Mob_Attack_Mob_Using_Skills ()

   Refresh_Buffs ()

   Check_If_Dead ()
Wend

Func Check_If_Dead ()
   ;Checks The Dead (Revive)_button
   $cords = PixelSearch(357,409,494,434,0x71BA82,5)
   if not @error then
      MouseClick($MOUSE_CLICK_LEFT,414,420,1,10)
      Sleep(1000)
   Else
   EndIF
EndFunc

Func Refresh_Buffs ()
   ;Not found Buff Icon 1 ? = uses key - & + (2 Buffs)
   $cords = PixelSearch(751,33,852,56,0x48F08B,5)
   if @error then
      send ("{-}")
      Sleep(1000)
      send("{+}")
      Sleep(1250)
   Else
   EndIf
EndFunc

Func Tab_Mob_Attack_Mob_Using_Skills ()
   Send("{Tab}")
   Sleep (250)
   ;Found a Mob? Icon
   $cords = PixelSearch(531,31,560,53,0x6385AB,5)
   if not @error then
      Send("1")
      Sleep(1000)
      Send("2")
      Sleep (250)
      Send("1")
      Sleep(2000)
      Send("3")
      Sleep (3000)
      Send("1")
      Sleep (3000)
      ;Using the Looting Function
      Looting(2)
      Sleep (3000)

      while ($attacking)
         ;Are we still attacking the mob?
         $isAttacking = Pixelsearch (539,42,541,44, 0x5D7DA1,1)
         if not(@error) then
         Else
            $attacking = false
         EndIF
      WEnd

      ;Are we healthy enough to continue attacking?
      $needrest = true
      $hpbar = PixelSearch (134,61,136,63,0xFF1465,1)
      if @error then
         Send("z")
         Sleep (3000)
         while ($needrest)
            $hpbar2 = PixelSearch (203,60,205,62,0xAF1C37,1)
            if not(@error) Then
            $needRest = False
            EndIf
         WEnd
      Else
         $needRest = False
      EndIf

      while ($needRest)
         ;Do we get attacked by another Mob? - means that we can't rest
         $isAttacking = Pixelsearch (340,98,765,498, 0xB7B8B6,5)
         if not(@error) then
            Send("{Tab}")
            Sleep (250)
            Send("1")
            Sleep(1000)
            Send("5")
            Sleep (1000)
            Send("6")
            Sleep(250)
         Else
         EndIF
      WEnd

   Else

   EndIF
EndFunc

Func Looting($count)
   for $x = 1 to $count
      send("x")
      Sleep(250)
   Next
EndFunc

Func myExit ()
   msgbox(0, "Ending","Bot has exited")
   Exit
EndFunc

 

  • Moderators
Posted

Welcome to the AutoIt forum.

Unfortunately you appear to have missed the Forum rules on your way in. Please read them now - particularly the bit about not discussing game automation - and then you will understand why you will get no help and this thread will now be locked.

See you soon with a legitimate question I hope.

The Moderation team

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...