Valhalla Legends Forums Archive | Battle.net Bot Development | [Python] MakeLong

AuthorMessageTime
Yegg
Ok, I need a little help with putting MakeLong in python. I'm assuming it is something like GetDWORD and GetWORD.

[code]    def MakeDWORD(n):
        return struct.pack("< I", n)[/code]

Banana fanna fo fanna showed me this code and helped me with it. I'm guessing that since both MakeLong and MakeWORD/DWORD use CopyMemory in VB6 that in Python they would both use the struct module. For MakeLong I have,

[code]    def MakeLong(x):
        if len(x) < 4:
            pass
        return struct.pack("< L", x)[/code]

My problem is that I'm not sure if I use L for unsigned long or if I use something else. And this probably isn't the only problem.
December 14, 2004, 12:42 AM
Zakath
Why are you making a long when you already have a DWORD?

DWORD is the exact same thing as an unsigned long.
December 14, 2004, 8:21 AM
Yegg
Umm, Oh, thanks.
December 14, 2004, 8:07 PM
St0rm.iD
Yegg, will you please RTFM. I've told you twice already; this is number 3. There's a nice easy table for you to use.
December 14, 2004, 8:27 PM
BaDDBLooD
[quote author=Zakath link=topic=9896.msg92347#msg92347 date=1103012507]
Why are you making a long when you already have a DWORD?

DWORD is the exact same thing as an unsigned long.
[/quote]

The reason why, is because he uses code that uses the "MakeLong" function, as well as the "Make DWORD", not knowing they are the same thing.  IMHO
December 15, 2004, 2:17 AM

Search