Jump to content

Cant Call Functions


Bullet
 Share

Recommended Posts

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
WinActivate("game")

#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("macro", 631, 123, 234, 178)
$Heal = GUICtrlCreateButton("Heal", 8, 16, 75, 25, $WS_GROUP)
$Button1 = GUICtrlCreateButton("Mana", 8, 49, 75, 25, $WS_GROUP)
GUICtrlCreateInput("", 88, 48, 49, 21)
$Button2 = GUICtrlCreateButton("Bind F4", 8, 80, 75, 25, $WS_GROUP)
GUICtrlCreateInput("", 88, 81, 49, 21)
GUICtrlCreateInput("", 88, 16, 49, 21)
$hp = GUICtrlCreateLabel("Coloque o HP necessário para healar. A magia de cura deve estar na hotkey F5.", 144, 16, 384, 17)
$Label2 = GUICtrlCreateLabel("Coloque a Mana necessária para usar poções de mana.", 144, 48, 268, 17)
$Label3 = GUICtrlCreateLabel("Substitua a Hotkey F4 por qualquer outra tecla do seu teclado.", 144, 82, 300, 17)
GUISetState(@SW_SHOW)
GUICtrlSetOnEvent($Heal, "Heal")
#EndRegion ### END Koda GUI section ###

Global $Paused
HotKeySet("{INS}", "TogglePause")
HotKeySet("{DELETE}", "_Heal")

While 1 = 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
    EndSwitch
Sleep(50)
WEnd
Exit

Func _Heal()
While 1 = 1
    
    If PixelGetColor($hp,240) = 0x101008 then
    Sleep(200)
        ControlSend("game", "", "", "{F5}") 
    Sleep(800)
    EndIf
    Sleep(100)
WEnd
EndFunc

Func TogglePause()
    $Paused = NOT $Paused
    While $Paused
        sleep(1000)
        ToolTip('Script is "Paused"',0,0)
    WEnd
    ToolTip("")
EndFunc

Well, Idk where is the problem, but probally it is when i call the function clicking on the button. Or probally when I type the pixel x position - string $hp it doesnt work.

Link to comment
Share on other sites

  • Moderators

Bullet,

Have you read the Announcement at the top of the forum? Does the game you are trying bot allow you to do such things?

Please either show us where in the rules of the game it says you can use bots - or explain why your bot does not go against the rules set out in the announcement. Then we will be delighted to help. :mellow:

M23

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

 

Link to comment
Share on other sites

Bullet,

Have you read the Announcement at the top of the forum? Does the game you are trying bot allow you to do such things?

Please either show us where in the rules of the game it says you can use bots - or explain why your bot does not go against the rules set out in the announcement. Then we will be delighted to help. :mellow:

M23

This is a macro for Dungeon Siege, there isnt any rules against cheating in this game, also It is for my own since this game is offline I dont see any problems creating tools to make the game a bit less hard.

Link to comment
Share on other sites

- Heal & _Heal is not the same.

thank you, but still doesnt work.

If I use a value instead of the string $hp it works, so the problem is probally in the Input Box.

edit: got it, working well.

I have another doubt, If position x=14 it result in 1% of HP and If position x=131 = 100% of HP

example: If PixelGetColor($hp,240) = 0x101008 then

for $hp = 14.

there is any way to turn this range 14~131 in a percentage?

Edited by Bullet
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

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