Network: WoW Gold | WoW Accounts | MPS Games | FPSowned
MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides
Homepage »      Register »      Hall of Fame »      Ranks And Awards »      Advertise »      Marketplace »
 
Sign up



Do you like this excellent information? Then Donate HERE to remove ads and support the MMOwned community.


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > World of Warcraft > Bots and Programs > WoW Memory Editing

WoW Memory Editing WoW Memory Editing for learning purposes only.
This section is more advanced than others on MMOwned Read the section specific rules, infractions will be given out if u break them!That is including the expectations! - If you don't meet them then don't post

Reply
 
LinkBack Thread Tools
  #1  
Old 09-24-2009
Viano's Avatar
Viano is offline.
Master Sergeant
  
 
Join Date: May 2008
Posts: 88
Reputation: 17
Points: 1,058, Level: 2
Points: 1,058, Level: 2 Points: 1,058, Level: 2 Points: 1,058, Level: 2
Level up: 32%, 342 Points needed
Level up: 32% Level up: 32% Level up: 32%
Activity: 0.4%
Activity: 0.4% Activity: 0.4% Activity: 0.4%

Who is attacking me?

Hi everyone,

how do you detect whether a mob is attacking you? When I just read the mob's target, sometimes mobs are targeting me without attacking and sometimes players do target me without attacking either.

Is there some flag like isInFightWithGuid?
__________________
Viano
http://www.mmowned.com/forums/bots-programs/171327-wow-toons-name-generator.html
Reply With Quote


Donate to remove ads, get your "DONATOR title, and get access to the MMOwned community's elite Shoutbawx.

  #2  
Old 09-24-2009
Kandyman's Avatar
Kandyman is offline.
New User
  
 
Join Date: Sep 2009
Posts: 4
Reputation: 1
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Level up: 13%, 349 Points needed
Level up: 13% Level up: 13% Level up: 13%
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
There's probably a better way to do it, but what I do is monitoring my Health all the time. Then, in a Timer, I got a procedure that looks like this:

Code:
if myHealth < myMaxHealth then

    //I lost some health, is someone attacking me or a priest buffed me ?
    tempHealth = myHealth

    if myHealth < tempHealth then  //there's definitly something wrong

         attack()

    End if

End if
It's not the real code, but it's pretty self explanary and it's the way I do it. It's working, but you have to take some damage before to fight back, wich is obviously, not the best method...
Reply With Quote
  #3  
Old 09-24-2009
Viano's Avatar
Viano is offline.
Master Sergeant
  
 
Join Date: May 2008
Posts: 88
Reputation: 17
Points: 1,058, Level: 2
Points: 1,058, Level: 2 Points: 1,058, Level: 2 Points: 1,058, Level: 2
Level up: 32%, 342 Points needed
Level up: 32% Level up: 32% Level up: 32%
Activity: 0.4%
Activity: 0.4% Activity: 0.4% Activity: 0.4%

Quote:
Originally Posted by Kandyman View Post
There's probably a better way to do it, but what I do is monitoring my Health all the time. Then, in a Timer, I got a procedure that looks like this:

Code:
if myHealth < myMaxHealth then

    //I lost some health, is someone attacking me or a priest buffed me ?
    tempHealth = myHealth

    if myHealth < tempHealth then  //there's definitly something wrong

         attack()

    End if

End if
It's not the real code, but it's pretty self explanary and it's the way I do it. It's working, but you have to take some damage before to fight back, wich is obviously, not the best method...
So if a debuff taking your health is on your toon after a fight you think you are beeing attacked?
__________________
Viano
http://www.mmowned.com/forums/bots-programs/171327-wow-toons-name-generator.html
Reply With Quote
  #4  
Old 09-24-2009
Kandyman's Avatar
Kandyman is offline.
New User
  
 
Join Date: Sep 2009
Posts: 4
Reputation: 1
Points: 51, Level: 1
Points: 51, Level: 1 Points: 51, Level: 1 Points: 51, Level: 1
Level up: 13%, 349 Points needed
Level up: 13% Level up: 13% Level up: 13%
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Quote:
So if a debuff taking your health is on your toon after a fight you think you are beeing attacked?
That would explain a lot of things ... lol

You are right, I even didn't think about it.
Reply With Quote
  #5  
Old 09-24-2009
ostapus is offline.
Sergeant
  
 
Join Date: Nov 2008
Posts: 67
Reputation: 32
Points: 477, Level: 1
Points: 477, Level: 1 Points: 477, Level: 1 Points: 477, Level: 1
Level up: 16%, 423 Points needed
Level up: 16% Level up: 16% Level up: 16%
Activity: 3.3%
Activity: 3.3% Activity: 3.3% Activity: 3.3%

Quote:
Originally Posted by Viano View Post
Hi everyone,

how do you detect whether a mob is attacking you? When I just read the mob's target, sometimes mobs are targeting me without attacking and sometimes players do target me without attacking either.

Is there some flag like isInFightWithGuid?
here is lua code, the one i am using

function _validEnemy(u)
local rc
rc = UnitExists(u) ;
rc = rc and not UnitIsDeadOrGhost(u) ;
rc = rc and UnitCanAttack("player", u) ;
rc = rc and not UnitIsPlayer(u) ;
rc = rc and (not UnitIsTapped(u) or (UnitIsTapped(u) and UnitIsTappedByPlayer(u)))
rc = rc and ( UnitAffectingCombat(u) or ( not UnitAffectingCombat(u) and UnitName(u .. "target") == UnitName("player")))
return rc
end
Reply With Quote
  #6  
Old 09-24-2009
xzidez is offline.
New User
  
 
Join Date: Dec 2007
Posts: 48
Reputation: 3
Points: 476, Level: 1
Points: 476, Level: 1 Points: 476, Level: 1 Points: 476, Level: 1
Level up: 16%, 424 Points needed
Level up: 16% Level up: 16% Level up: 16%
Activity: 5.2%
Activity: 5.2% Activity: 5.2% Activity: 5.2%

Hi

One simple solution would be to check if you are in combat.
if you are in combat scan nearby mobs. If any mob is targeting you ..

you can be fairly sure he is attacking you. :P

Last edited by xzidez; 09-24-2009 at 12:22 PM.
Reply With Quote
  #7  
Old 09-24-2009
Viano's Avatar
Viano is offline.
Master Sergeant
  
 
Join Date: May 2008
Posts: 88
Reputation: 17
Points: 1,058, Level: 2
Points: 1,058, Level: 2 Points: 1,058, Level: 2 Points: 1,058, Level: 2
Level up: 32%, 342 Points needed
Level up: 32% Level up: 32% Level up: 32%
Activity: 0.4%
Activity: 0.4% Activity: 0.4% Activity: 0.4%

Quote:
Originally Posted by ostapus View Post
here is lua code, the one i am using

function _validEnemy(u)
local rc
rc = UnitExists(u) ;
rc = rc and not UnitIsDeadOrGhost(u) ;
rc = rc and UnitCanAttack("player", u) ;
rc = rc and not UnitIsPlayer(u) ;
rc = rc and (not UnitIsTapped(u) or (UnitIsTapped(u) and UnitIsTappedByPlayer(u)))
rc = rc and ( UnitAffectingCombat(u) or ( not UnitAffectingCombat(u) and UnitName(u .. "target") == UnitName("player")))
return rc
end
Ok, that would probably work but looks like an overkill. Thank you.
What parameter is u? Is it the Guid?

Quote:
Originally Posted by xzidez View Post
...
One simple solution would be to check if you are in combat.
if you are in combat scan nearby mobs. If any mob is targeting you ..

you can be fairly sure he is attacking you. :P
That is not a solution because players and mobs are sometimes targeting me without fighting with me.
__________________
Viano
http://www.mmowned.com/forums/bots-programs/171327-wow-toons-name-generator.html

Last edited by Viano; 09-24-2009 at 12:47 PM.
Reply With Quote
  #8  
Old 09-24-2009
ostapus is offline.
Sergeant
  
 
Join Date: Nov 2008
Posts: 67
Reputation: 32
Points: 477, Level: 1
Points: 477, Level: 1 Points: 477, Level: 1 Points: 477, Level: 1
Level up: 16%, 423 Points needed
Level up: 16% Level up: 16% Level up: 16%
Activity: 3.3%
Activity: 3.3% Activity: 3.3% Activity: 3.3%

Quote:
Originally Posted by Viano View Post
Ok, that would probably work but looks like an overkill. Thank you.
What parameter is u? Is it the Guid?



That is not a solution because players and mobs are sometimes targeting me without fighting with me.
u - is standard wow unit, like "target", "focus" etc....

in that case i am using "EnumVisibleObjects" with calllback like this one

function enumCallback(hguid, lguid)
_SetFocus(hguid, lguid)
if ( _validEnemy("focus") ) then <we found enemy who is attacking us or we can attack>; SetTarget(hguid, lguid); end
end
Reply With Quote
  #9  
Old 09-24-2009
Tanaris4 is offline.
Sergeant Major
  
 
Join Date: Oct 2008
Posts: 146
Reputation: 12
Points: 1,169, Level: 2
Points: 1,169, Level: 2 Points: 1,169, Level: 2 Points: 1,169, Level: 2
Level up: 54%, 231 Points needed
Level up: 54% Level up: 54% Level up: 54%
Activity: 6.2%
Activity: 6.2% Activity: 6.2% Activity: 6.2%

Quote:
Originally Posted by ostapus View Post
u - is standard wow unit, like "target", "focus" etc....

in that case i am using "EnumVisibleObjects" with calllback like this one

function enumCallback(hguid, lguid)
_SetFocus(hguid, lguid)
if ( _validEnemy("focus") ) then <we found enemy who is attacking us or we can attack>; SetTarget(hguid, lguid); end
end
I take it EnumVisibleObjects is a function you are calling via injection? Do you think this is available as a flag for those who only do memory reading?
Reply With Quote
  #10  
Old 09-24-2009
ostapus is offline.
Sergeant
  
 
Join Date: Nov 2008
Posts: 67
Reputation: 32
Points: 477, Level: 1
Points: 477, Level: 1 Points: 477, Level: 1 Points: 477, Level: 1
Level up: 16%, 423 Points needed
Level up: 16% Level up: 16% Level up: 16%
Activity: 3.3%
Activity: 3.3% Activity: 3.3% Activity: 3.3%

Quote:
Originally Posted by Tanaris4 View Post
I take it EnumVisibleObjects is a function you are calling via injection? Do you think this is available as a flag for those who only do memory reading?
why not ? there are tons of examples on this forum how to iterate over object list out of proc and execute lua string

pseudo code

notfound = true ;
object = ObjectList ;
targetguid = 0 ;
while (object && targetguid == 0)
{
guid = object.guid
setfocus(guid)
rc = lua_doString("IsEnemy(\"focus\")") ;
if ( rc ) targetguid = guid ;
object = getnextobject ;
}
if ( targetguid )
here is our enemy

something like that...
Reply With Quote
  #11  
Old 09-24-2009
Tanaris4 is offline.
Sergeant Major
  
 
Join Date: Oct 2008
Posts: 146
Reputation: 12
Points: 1,169, Level: 2
Points: 1,169, Level: 2 Points: 1,169, Level: 2 Points: 1,169, Level: 2
Level up: 54%, 231 Points needed
Level up: 54% Level up: 54% Level up: 54%
Activity: 6.2%
Activity: 6.2% Activity: 6.2% Activity: 6.2%

How do you use lua_doString out of process?
Reply With Quote
  #12  
Old 09-24-2009
Viano's Avatar
Viano is offline.
Master Sergeant
  
 
Join Date: May 2008
Posts: 88
Reputation: 17
Points: 1,058, Level: 2
Points: 1,058, Level: 2 Points: 1,058, Level: 2 Points: 1,058, Level: 2
Level up: 32%, 342 Points needed
Level up: 32% Level up: 32% Level up: 32%
Activity: 0.4%
Activity: 0.4% Activity: 0.4% Activity: 0.4%

Quote:
Originally Posted by Tanaris4 View Post
How do you use lua_doString out of process?
Asm. Lots of my noobish posts in this forum
__________________
Viano
http://www.mmowned.com/forums/bots-programs/171327-wow-toons-name-generator.html
Reply With Quote
  #13  
Old 09-25-2009
MaiN is offline.
Contributor
  
 
Join Date: Sep 2006
Location: Jaedenar O.o
Posts: 569
Reputation: 162
Points: 3,264, Level: 5
Points: 3,264, Level: 5 Points: 3,264, Level: 5 Points: 3,264, Level: 5
Level up: 58%, 336 Points needed
Level up: 58% Level up: 58% Level up: 58%
Activity: 8.6%
Activity: 8.6% Activity: 8.6% Activity: 8.6%

Quote:
Originally Posted by Viano View Post
Asm. Lots of my noobish posts in this forum
Well, fasm_managed uses CreateRemoteThread to execute the ASM, so it's not completely out of process.
Might be the only possible way to use the ASM though
__________________
http://www.main-dev.com/

I was here. ~Dragon[Sky]
I was here too. ~Kuiren
Reply With Quote
  #14  
Old 09-25-2009
Viano's Avatar
Viano is offline.
Master Sergeant
  
 
Join Date: May 2008
Posts: 88
Reputation: 17
Points: 1,058, Level: 2
Points: 1,058, Level: 2 Points: 1,058, Level: 2 Points: 1,058, Level: 2
Level up: 32%, 342 Points needed
Level up: 32% Level up: 32% Level up: 32%
Activity: 0.4%
Activity: 0.4% Activity: 0.4% Activity: 0.4%

Ok, the easiest way to achieve this is comparing whether a mob is in combat and has me as target.

Quote:
// IsAttackingMe ripped of from BabBot
Convert.ToBoolean((ReadDescriptor<uint>(Constants.UnitFields.UNIT_FIELD_FLAGS) >> 0x13) & 1);
__________________
Viano
http://www.mmowned.com/forums/bots-programs/171327-wow-toons-name-generator.html
Reply With Quote
  #15  
Old 09-25-2009
ostapus is offline.
Sergeant
  
 
Join Date: Nov 2008
Posts: 67
Reputation: 32
Points: 477, Level: 1
Points: 477, Level: 1 Points: 477, Level: 1 Points: 477, Level: 1
Level up: 16%, 423 Points needed
Level up: 16% Level up: 16% Level up: 16%
Activity: 3.3%
Activity: 3.3% Activity: 3.3% Activity: 3.3%

Quote:
Originally Posted by Viano View Post
Ok, the easiest way to achieve this is comparing whether a mob is in combat and has me as target.
if you solo - yes (there are some exception though, rare one). if you in group - mob may not attack you )
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



All times are GMT -4. The time now is 07:41 AM.




Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.1

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493