| View previous topic :: View next topic |
| Author |
Message |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Sun Aug 30, 2009 3:23 pm Post subject: Problem with function |
|
|
hi
ive created a function, but it doesnt work 100%
| Code: | void UnlimitedAttkOn (HWND hWnd)
{
int OldXPos = 0;
SetDlgItemText(hWnd, IDC_UNLIMITEDATTK, "On" ); //On
unsigned int LWall = (ReadPointer((ULONG_PTR*)LeftWall, LeftWallOffset));
unsigned int RWall = (ReadPointer((ULONG_PTR*)RightWall, RightWallOffset));
unsigned int Char = (ReadPointer((ULONG_PTR*)CharMapBytes, CharXBytes));
int counter = 0;
while (!UnlimitedAttkExit)
{
if (ReadPointer((ULONG_PTR*)AttkReadBase, AttkReadOffsetCharBase) >= 99)
{
OldXPos = ReadPointer((ULONG_PTR*)CharMapBytes, CharXBytes); //Get Old X Pos
while (ReadPointer((ULONG_PTR*)AttkReadBase, AttkReadOffsetCharBase) >= 99)
{
if (counter = 1)
{
if ( RWall <= (ReadPointer((ULONG_PTR*)ItemPBase, ItemBaseOffset)) + 15)
{
counter = 0;
}
else
{
*(DWORD*)(*(DWORD*)ItemPBase + ItemBaseOffset) = OldXPos + 15;
Sleep (1);
}
}
else
{
if ( LWall >= (ReadPointer((ULONG_PTR*)ItemPBase, ItemBaseOffset)) - 15)
{
counter = 1;
}
else
{
*(DWORD*)(*(DWORD*)ItemPBase + ItemBaseOffset) = OldXPos - 15;
Sleep (1);
}
}
}
}
Sleep (100);
}
SetDlgItemText(hWnd, IDC_UNLIMITEDATTK, "Off" );
} |
Its something that reset the attack counter of a game, so the coordinates of the character goes -15, but if u touch the wall , its bans u, so i thought i create a check for that, so it goes + 15 till the attack counter has reseted itself by time:)
it works fine when im not against a wall, so i think it has something to do with the counter
|
|
| Back to top |
|
 |
manc Grandmaster Cheater
Reputation: 1
Joined: 16 Jun 2006 Posts: 551
|
Posted: Sun Aug 30, 2009 6:08 pm Post subject: |
|
|
herp derp.
_________________
Last edited by manc on Mon Aug 31, 2009 8:00 am; edited 1 time in total |
|
| Back to top |
|
 |
HolyBlah Master Cheater
Reputation: 2
Joined: 24 Aug 2007 Posts: 446
|
Posted: Sun Aug 30, 2009 7:58 pm Post subject: |
|
|
| will always return true.
|
|
| Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Mon Aug 31, 2009 1:17 am Post subject: |
|
|
| manc wrote: | might want to reconsider your use of loops
it will go straight to the else if you didnt know that. |
i dont see why that would happen
| HolyBlah wrote: | | will always return true. |
why? if counter = 0?
|
|
| Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Mon Aug 31, 2009 1:30 am Post subject: |
|
|
| NoMercy wrote: | | manc wrote: | might want to reconsider your use of loops
it will go straight to the else if you didnt know that. |
i dont see why that would happen
| HolyBlah wrote: | | will always return true. |
why? if counter = 0? |
= is assignment, == is comparison
manc is wrong, if(counter = 1) will make counter equal 1, which will have the glorious result of making it so you will never get to the else.
|
|
| Back to top |
|
 |
NoMercy Master Cheater
Reputation: 1
Joined: 09 Feb 2009 Posts: 289
|
Posted: Mon Aug 31, 2009 1:41 am Post subject: |
|
|
omg, thanks so stupid of me
i changed it to ==, but still i did something wrong O.o i thought i did it well
|
|
| Back to top |
|
 |
|