[-]
Shout:
Click Refresh to load shouts.

Thread Closed 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to check player flags?
02-25-2010, 06:44 AM
Post: #11
RE: how to check player flags?
(02-24-2010 11:45 PM)Pro-grammer Wrote:  You can't deny that Mega, or Yaboo their bots are based upon a source, or a start. How you think they learn ?

Our bots are based on hard work and big help from this community.
Ban this asshole cuz I cant read his posts. If you dont know how to do something even if you got everything you need it means that you should start with something easier.
TibiaApi have everything that you are asking for. If you dont know how to use it go and read something about delphi.

Stop acting like a kid or you will never get any help from us.
Visit this user's website Find all posts by this user
02-25-2010, 11:36 AM (This post was last modified: 02-25-2010 11:45 AM by megano0body. Edit Reason: )
Post: #12
RE: how to check player flags?
(02-24-2010 11:45 PM)Pro-grammer Wrote:  An start is not so bad

You can't deny that Mega, or Yaboo their bots are based upon a source, or a start. How you think they learn ?, I did not asked for a copy+paste script, i said that an initial, is a good base to make it grow up to other objects, it's like a poison checker, and burning checker. Then with this example, i may learn how it works, and do the others my self. Has it's about calculation. And how the hell you want me to calculate flags when there are no flags, or ANYTHING related that is not "packet.dll" in this delphi area?.

There is nothing, of nothing to nothing.

Btw, my first and main used language is PHP, i learned PHP before all the others, i programmed for more than 7 years and started programming bot for like 4 years, do you really think that i copied and pasted codes?
I have not started programming tibia bots, its very hard, i started with scripting & otservers, then i made some codes in otserver and finally learned php to make websites and make some money with it.

I have made several codes, and learned several books before come to Cheats Programming, and no, you can't learn Cheat Programming copying and pasting, you need to understand it, im in the tp forums for more than 3 years, i found this amazing forum forum before 2007, i learned a lot before start making a bot. (Candy tool was the best)

And you are a ignorant like Darkstar said, he posted a very nice article that teachs all you need and you ignored it searching for a full code.

People like you dont deserves help, deserves a kick in the ass.

I started programming before the TibiaAPI. You can check my profile, i hate to ask help to others, i prefer to do the things by my self. When i started making my bot, i dont had the articles that you have today, in this forum, and you... youre a shit that needs all done to make your own.

http://www.bmega.net/ - Get BBOT for 8.5 tibia ITS FREE
Find all posts by this user
02-25-2010, 02:58 PM (This post was last modified: 02-25-2010 02:59 PM by klusbert. Edit Reason: )
Post: #13
RE: how to check player flags?
Maybe abit oftopic, but darkstar where do u find this realy nice and easy programing school articles?

I think Im a great googler, but my english is to bad to know this kind of wordsTongue

I wan't to be reborn in USA.
Find all posts by this user
02-25-2010, 03:47 PM (This post was last modified: 02-25-2010 03:47 PM by DarkstaR. Edit Reason: )
Post: #14
RE: how to check player flags?
(02-25-2010 02:58 PM)klusbert Wrote:  Maybe abit oftopic, but darkstar where do u find this realy nice and easy programing school articles?

I think Im a great googler, but my english is to bad to know this kind of wordsTongue

I wan't to be reborn in USA.

I found that article with google. You just need to know the right search terms.

While "reading flags" will give you so many unrealted sites, "reading binary flags" gives you almost exactly what you need. You just need to know the proper terms Smile

Find all posts by this user
02-25-2010, 09:28 PM (This post was last modified: 02-25-2010 09:34 PM by Pro-grammer. Edit Reason: )
Post: #15
RE: how to check player flags?
select delphi
type
  TFlags = record
  Battle,Haste,Paralyze,MShield,Drunk,Energy,Fire,Poison,CannotLogoutOrEnterProtec​tionZone,WithinProtectionZone:Boolean
end;


select delphi
function GetStatus: TFlags;
var
  Status:Integer;
begin
  Status:=ReadMemInt(Player_Status);
  if Status >= 128 then
  begin
    Result.Battle:=True;
    Status:=Status-128;
  end;
  if Status >= 64 then
  begin
    Result.Haste:=True;
    Status:=Status-64;
  end;
  if Status >= 32 then
  begin
    Result.Paralyze:=True;
    Status:=Status-32;
  end;
  if Status >= 16 then
  begin
    Result.MShield:=True;
    Status:=Status-16;
  end;
  if Status >= 8 then
  begin
    Result.Drunk:=True;
    Status:=Status-8;
  end;
  if Status >= 4 then
  begin
    Result.Energy:=True;
    Status:=Status-4;
  end;
  if Status >= 2 then
  begin
    Result.Fire:=True;
    Status:=Status-2;
  end;
  if Status >= 1 then
  begin
    Result.Poison:=True;
  end;
  if Status >= 16384 then
    result.WithinProtectionZone:=true;
  if status >= 8182 then
    result.CannotLogoutOrEnterProtectionZone:=true;
end;


Darkstar you make me to read the whole posts again, to see "what is the main topic". You are redirecting it to other way. When the only thing i said is that no one wants to give an start. And i'd know, that a begining is isn't so bad. So i did this. It's not working properly but nvm.

If you guys dont want to help then DON'T.
But i know, that i'll release all things for my bot, so it'll by "FreeBot" OpenSource, and everyone may use it. Kind of TibiaAPI. Without any cares about credits, or fame.
Find all posts by this user
02-26-2010, 12:30 AM
Post: #16
RE: how to check player flags?
I don't believe your code will work correctly; basically you are reading a bit mask. You'd want to do it more like this:

[Flags]
enum PlayerStatus
{
    Poison = 1,
    Fire = 2,
    Energy = 4,
    ...
}
 
PlayerStatus status = (PlayerStatus)ReadInt();
bool isBurning = (status & PlayerStatus.Fire) != 0;


Basically, you use the "bitwise and" operator. If status has the same bits set as Fire, status & Fire will equal Fire. If not, it will equal zero.

TibiaAPI, SharpOT
Visit this user's website Find all posts by this user
02-26-2010, 11:51 AM (This post was last modified: 02-26-2010 11:52 AM by megano0body. Edit Reason: N/A)
Post: #17
RE: how to check player flags?
Well, the player flags are bits
101010101011011

1 is actived, 0 is deactived.

Flags Samples:
PoisonFlag = 1 shr 0,
DrunkFlag = 1 shl 3,
ManaShieldFlag = 1 shl 4,

1 shr 4 = 16, mana shield flag Smile

Shr is a bitwise operator \o/



To check if your player has a certain flags you need to check its bit..
You need to use the bitwise operators.. Sample:

001010
AND
001000
RETURNS
001000

If you read the darkstar tutorial you will learn all those tricks...

To Copy & Paste.. Use it:

select delphi
IsPoisoned (boolean) := (StatusFlags AND PoisonFlag) = PoisonFlag;


(StatusFlags AND PoisonFlag) = PoisonFlag
000000001 000000001 = 000000001

http://www.bmega.net/ - Get BBOT for 8.5 tibia ITS FREE
Find all posts by this user
02-26-2010, 12:47 PM
Post: #18
RE: how to check player flags?
Thank you Ian, That code is totally simple, i just needed to understand it. And it's easy to transform it to Delphi.

Thanks BBot *-*

I just dont get a point, or maybe they are just an example?.

PoisonFlag = 1 shr 0,
DrunkFlag = 1 shl 3,
ManaShieldFlag = 1 shl 4,

i was confused at this part, has manashield flag is 16, i look toward "delphi shl", and now i understand how it works: http://www.delphibasics.co.uk/RTL.asp?Name=Shl

Today i'll try to perform a whole casting for the player flags, and release them. It's just i have a wedding day today, so am kind of busy.

However, thanks for the help, that start is totally what i needed.
Find all posts by this user
02-26-2010, 01:30 PM
Post: #19
RE: how to check player flags?
Omg noob xd

select delphi
type
  TTibiaDat = record
    WalkSpeed : boolean;
    TopOrder1 : boolean;
    TopOrder2 : boolean;
    TopOrder3 : boolean;
    IsContainer : boolean;
    IsStackable : boolean;
    IsCorpse : boolean;
    IsUsable : boolean;
    IsRune : boolean;
    IsWritable : boolean;
    IsReadable : boolean;
    IsFluid : boolean;
    IsSplash : boolean;
    Blocking : boolean;
    IsImmovable : boolean;
    BlocksMissiles : boolean;
    BlocksPath : boolean;
    IsPickupable : boolean;
    IsHangable : boolean;
    IsHangableHorizontal : boolean;
    IsHangableVertizcal : boolean;
    IsRotatable : boolean;
    IsLightSource : boolean;
    Floorchange : boolean;
    IsShifted : boolean;
    HasHeight : boolean;
    IsLayer : boolean;
    IsIdleAnimation : boolean;
    HasAutoMapColor : boolean;
    HasHelpLens : boolean;
    IsGround : boolean;
end;
 
function GetItemData(id:integer): TTibiaDat;
var
flag:longword;
output: LongWord;
heapstart: LongWord;
pt:pointer;
begin
 
  output := pinteger(ItemDataAdr)^ + $08;
  heapstart := pinteger(output)^;
 
  pt:=ptr(heapstart + $50 * (id - 100) + 9 * 4);
  flag := pinteger(pt)^;
 
  result.WalkSpeed := (flag and $1) = $1;
  result.TopOrder1 := (flag and $2) = $2;
  result.TopOrder2 := (flag and $4) = $4;
  result.TopOrder3 := (flag and $8) = $8;
  result.IsContainer := (flag and $10) = $10;
  result.IsStackable := (flag and $20) = $20;
  result.IsCorpse:= (flag and $40) = $40;
  result.IsUsable := (flag and $80) = $80;
  result.IsRune := (flag and $100) = $100;
  result.IsWritable := (flag and $200) = $200;
  result.IsReadable := (flag and $400) = $400;
  result.IsFluid := (flag and $800) = $800;
  result.IsSplash := (flag and $1000) = $1000;
  result.Blocking := (flag and $2000) = $2000;
  result.IsImmovable := (flag and $4000) = $4000;
  result.BlocksMissiles := (flag and $8000) = $8000;
  result.BlocksPath := (flag and $10000) = $10000;
  result.IsPickupable := (flag and $20000) = $20000;
  result.IsHangable := (flag and $40000) = $40000;
  result.IsHangableHorizontal := (flag and $80000) = $80000;
  result.IsHangableVertizcal := (flag and $100000) = $100000;
  result.IsRotatable := (flag and $200000) = $200000;
  result.IsLightSource := (flag and $400000) = $400000;
  result.Floorchange := (flag and $800000) = $800000;
  result.IsShifted := (flag and $1000000) = $1000000;
  result.HasHeight := (flag and $2000000) = $2000000;
  result.IsLayer := (flag and $4000000) = $4000000;
  result.IsIdleAnimation := (flag and $8000000) = $8000000;
  result.HasAutoMapColor := (flag and $10000000) = $10000000;
  result.HasHelpLens := (flag and $20000000) = $20000000;
  result.IsGround := (flag and $40000000) = $40000000;
end;


It was so hard? ;d
Visit this user's website Find all posts by this user
02-26-2010, 02:52 PM
Post: #20
RE: how to check player flags?
(02-26-2010 01:30 PM)Yaboomaster Wrote:  Omg noob xd

select delphi
type
  TTibiaDat = record
    WalkSpeed : boolean;
    TopOrder1 : boolean;
    TopOrder2 : boolean;
    TopOrder3 : boolean;
    IsContainer : boolean;
    IsStackable : boolean;
    IsCorpse : boolean;
    IsUsable : boolean;
    IsRune : boolean;
    IsWritable : boolean;
    IsReadable : boolean;
    IsFluid : boolean;
    IsSplash : boolean;
    Blocking : boolean;
    IsImmovable : boolean;
    BlocksMissiles : boolean;
    BlocksPath : boolean;
    IsPickupable : boolean;
    IsHangable : boolean;
    IsHangableHorizontal : boolean;
    IsHangableVertizcal : boolean;
    IsRotatable : boolean;
    IsLightSource : boolean;
    Floorchange : boolean;
    IsShifted : boolean;
    HasHeight : boolean;
    IsLayer : boolean;
    IsIdleAnimation : boolean;
    HasAutoMapColor : boolean;
    HasHelpLens : boolean;
    IsGround : boolean;
end;
 
function GetItemData(id:integer): TTibiaDat;
var
flag:longword;
output: LongWord;
heapstart: LongWord;
pt:pointer;
begin
 
  output := pinteger(ItemDataAdr)^ + $08;
  heapstart := pinteger(output)^;
 
  pt:=ptr(heapstart + $50 * (id - 100) + 9 * 4);
  flag := pinteger(pt)^;
 
  result.WalkSpeed := (flag and $1) = $1;
  result.TopOrder1 := (flag and $2) = $2;
  result.TopOrder2 := (flag and $4) = $4;
  result.TopOrder3 := (flag and $8) = $8;
  result.IsContainer := (flag and $10) = $10;
  result.IsStackable := (flag and $20) = $20;
  result.IsCorpse:= (flag and $40) = $40;
  result.IsUsable := (flag and $80) = $80;
  result.IsRune := (flag and $100) = $100;
  result.IsWritable := (flag and $200) = $200;
  result.IsReadable := (flag and $400) = $400;
  result.IsFluid := (flag and $800) = $800;
  result.IsSplash := (flag and $1000) = $1000;
  result.Blocking := (flag and $2000) = $2000;
  result.IsImmovable := (flag and $4000) = $4000;
  result.BlocksMissiles := (flag and $8000) = $8000;
  result.BlocksPath := (flag and $10000) = $10000;
  result.IsPickupable := (flag and $20000) = $20000;
  result.IsHangable := (flag and $40000) = $40000;
  result.IsHangableHorizontal := (flag and $80000) = $80000;
  result.IsHangableVertizcal := (flag and $100000) = $100000;
  result.IsRotatable := (flag and $200000) = $200000;
  result.IsLightSource := (flag and $400000) = $400000;
  result.Floorchange := (flag and $800000) = $800000;
  result.IsShifted := (flag and $1000000) = $1000000;
  result.HasHeight := (flag and $2000000) = $2000000;
  result.IsLayer := (flag and $4000000) = $4000000;
  result.IsIdleAnimation := (flag and $8000000) = $8000000;
  result.HasAutoMapColor := (flag and $10000000) = $10000000;
  result.HasHelpLens := (flag and $20000000) = $20000000;
  result.IsGround := (flag and $40000000) = $40000000;
end;


It was so hard? ;d

I like how your codes are so clean, but the bot interface is horrible!. Add XPMan to the uses list for atleast. This will make it a bit more atractive.

Okay, now i am leaving to the wedding, i still need to dress up.
Believe i have 0 time, there are alot of things that are not completed.

I'm making my own things just like this one. Iwont Copy Paste this, i dont think i'll use cave bot.
Find all posts by this user
Thread Closed 



Contact UsTProgrammingReturn to TopReturn to ContentLite (Archive) ModeRSS Syndication