Sign in to follow this  
Followers 0
Its2l82die

DllCall won't work after an If statement

6 posts in this topic

Hi,

I'm having some problems with my script now if any of you know how to use PostMessage in a dll you'll probably understand my problem.

What I'm trying to do is send a certain key when the value of one pointer is smaller than the value of another so here is the script:

#include <NomadMemory.au3>
HotKeySet("+x","Terminate")
Func Terminate ()
    Exit 0      
EndFunc

Global $WMKEYDOWN = 0x100
Global $WMKEYUP = 0x101
Global $key = 0x33;the value of the key to send for info http://api.farmanager.com/en/winapi/virtualkeycodes.html
Global $key1 = 0x67; Heal key
Global $nottouse = InputBox("Handle","Input the Handle of your application that you don't want to be used (in this format 0x00000000)")
Global $hwnd = WinList("Battles for Glory")
Global $pids = ProcessList("l2.exe")
Global $baseaddr = "0x10969D60"
Global $offset [10]
$offset [0] = 0
$offset [1] = Dec ("114")
$offset [2] = Dec ("0")
$offset [3] = Dec ("C")
$offset [4] = Dec ("0")
$offset [5] = Dec ("4C")
$offset [6] = Dec ("684")
$offset [7] = Dec ("3C4")
$offset [8] = Dec ("5FC")
$offset [9] = Dec ("524")
Global $offset1 [10]
$offset1 [0] = 0
$offset1 [1] = Dec ("114")
$offset1 [2] = Dec ("0")
$offset1 [3] = Dec ("C")
$offset1 [4] = Dec ("0")
$offset1 [5] = Dec ("4C")
$offset1 [6] = Dec ("684")
$offset1 [7] = Dec ("3C4")
$offset1 [8] = Dec ("5FC")
$offset1 [9] = Dec ("51C")

    While 1
        For $i=1 To $hwnd [0][0]
                $prohwnd = _MemoryOpen($pids [$i][1])
                $hp = _MemoryPointerRead ($baseaddr,$prohwnd,$offset)
                $hpmax = _MemoryPointerRead ($baseaddr,$prohwnd,$offset1)
            If $hp [1] < $hpmax [1] Then
                MsgBox(0,"",""&$hp [1]&","&$hpmax [1]&"")
                DllCall("BypassedPostmessage.dll","int","myPostMessageA","hwnd",$hwnd [$i][1],"long",$WMKEYDOWN,"long",$key1,"long",0)
                Sleep(10)
            EndIf
        Next
    WEnd

As you can see I have this line in my script:

MsgBox(0,"",""&$hp [1]&","&$hpmax [1]&"")

I use it just to see if my pointers work and they do work fine (I see the message only when the value of $hpmax [1] is bigger than $hp [1]) now the problem is that the DllCall doesn't send the key at all.

If anyone sees my problem please show it to me.

Thanks in advance.

Share this post


Link to post
Share on other sites



Discussion of game bots is prohibited.

Share this post


Link to post
Share on other sites

Discussion of game bots is prohibited.

That's not true.

Discussion of game bots that are prohibited is prohibited.


♡♡♡

.

eMyvnE

Share this post


Link to post
Share on other sites

Okay well in this case, straight from the Battles For Glory website:

It is forbidden to use program that emulates the presence of a player in the game or disrupt the normal functioning of the server software. By such means the program, change the client or his substitute, and facilitate or alter the gameplay not game methods. Such as:-show information about other characters do not set the game developers, for example HP goal.-Automate gameplay. Automating-entrance into the game after the restart.-Using, programming methods, mistakes and shortcomings games as a player with skidyvanie Target, temporary disconnect, etc. Exception - Subscribers package "Professional", the characters are in the nuc-zone and are used for crafting and trade.

http://translate.googleusercontent.com/translate_c?hl=en&sl=ru&tl=en&u=http://www.bsfg.ru/%3Frules&rurl=translate.google.com&usg=ALkJrhjZAzO9ccwcFg9g5ZNgwPEVq_TMuw

Share this post


Link to post
Share on other sites

Thanks for nothing!

Found my error and fixed it myself.

If anyone is interested as to where I was wrong it was the synchronization problem of the PID and the handles take a look at the script carefully and you'll see it.

Anyway again thanks for nothing :mellow:

Share this post


Link to post
Share on other sites

Thanks for nothing!

Found my error and fixed it myself.

If anyone is interested as to where I was wrong it was the synchronization problem of the PID and the handles take a look at the script carefully and you'll see it.

Anyway again thanks for nothing :mellow:

Is it possible that you are that dumb?

♡♡♡

.

eMyvnE

Share this post


Link to post
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
Sign in to follow this  
Followers 0