Zepheus check if mob equals id?

Results 1 to 12 of 12
  1. #1
    Enthusiast SlowLoris is offline
    MemberRank
    Mar 2016 Join Date
    31Posts

    Zepheus check if mob equals id?

    Hello,
    I started developing a script for the Zepheus emulator. I want to check if a mob equals an specific id.
    This here is a horrable example, that won't work:
    Code:
    List<Mob> Monsters = new List<Mob>();
    
    
    for (Mob monsters in Monsters)
    {
        if (monsters == 1) // i want to check if the monsters equal a specific id.
        {
            // It's a secret...
        }
    }


  2. #2
    aka saze xteslaz is offline
    MemberRank
    Jul 2014 Join Date
    222Posts

    Re: Zepheus check if mob equals id?

    What.

    Sent from my SM-G900F using Tapatalk

  3. #3
    Banned Slimey is offline
    BannedRank
    Jan 2016 Join Date
    22Posts

    Re: Zepheus check if mob equals id?

    Quote Originally Posted by SlowLoris View Post
    Hello,
    for (Mob monsters in Monsters)
    [/code]
    Here's your problem.

  4. #4
    aka saze xteslaz is offline
    MemberRank
    Jul 2014 Join Date
    222Posts

    Re: Zepheus check if mob equals id?

    @Slimey
    What, lol.

    Sent from my SM-G900F using Tapatalk

  5. #5
    Banned Slimey is offline
    BannedRank
    Jan 2016 Join Date
    22Posts

    Re: Zepheus check if mob equals id?

    Quote Originally Posted by xteslaz View Post
    @Slimey
    What, lol.

    Sent from my SM-G900F using Tapatalk
    Was a joke.

    Because that "for" statement is hilarious.

    But if you mean like

    Code:
    foreach (Mob monster in Mobs)
    {
         if (monster.ID == 1)
         {
    
         }
    }
    This is assuming you have a property named ID, pretty simple actually ._.

    Btw: Not even trying to be mean or anything, but if you don't understand the basic use of properties and fields in C#, I really, REALLY, advise against trying to work on an emulator.

  6. #6
    aka saze xteslaz is offline
    MemberRank
    Jul 2014 Join Date
    222Posts

    Re: Zepheus check if mob equals id?

    Quote Originally Posted by Slimey View Post
    Was a joke.

    Because that "for" statement is hilarious.

    But if you mean like

    Code:
    foreach (Mob monster in Mobs)
    {
         if (monster.ID == 1)
         {
    
         }
    }
    This is assuming you have a property named ID, pretty simple actually ._.

    Btw: Not even trying to be mean or anything, but if you don't understand the basic use of properties and fields in C#, I really, REALLY, advise against trying to work on an emulator.
    if (Slime.ID == 1)
    then [execute random code]

    Or what. qq

  7. #7
    Gruntilda Gruntilda is offline
    MemberRank
    Apr 2010 Join Date
    468Posts

    Re: Zepheus check if mob equals id?

    You shouldn't use foreach.

  8. #8
    ExtrinsicStudio™ Myth is offline
    MemberRank
    Jan 2012 Join Date
    367Posts

    Re: Zepheus check if mob equals id?

    Code:
    int upperBound = Mobs.Count;
    
    for (int i = upperBound; i > 0; i--)
    {
        Mob mob = Mobs[i - 1];
        if (mob.ID == 0xB00B1E5)
        {
            // do your secret code here
        }
    }
    Those who can work out why the above is gravy get a cookie, the above would also use a custom List class, rather than default (where-by Count is an integer variable, rather than a method that recounts).

  9. #9
    Enthusiast SlowLoris is offline
    MemberRank
    Mar 2016 Join Date
    31Posts

    Re: Zepheus check if mob equals id?

    @Myth
    Very nice. I like the 0xB00B1E5

  10. #10
    Apprentice Iceslap is offline
    MemberRank
    Mar 2016 Join Date
    6Posts

    @Myth Is this possible too?

    Code:
    int upperBound = Mobs.Count;
    for (int i = upperBound; i > 0; i--)
    {
        Mob mob = Mobs[i - 1];
        if (mob.ID == 0xA55 || mob.ID == 0xB00B1E5)
        {
            // do your secret code here
        }
    }
    @Myth
    Is this possible too or would this break your code?
    P.S. Thanks for the opcode, i will be adding this one to my emulator : )
    Last edited by Iceslap; 04-04-16 at 06:17 PM.

  11. #11
    ExtrinsicStudio™ Myth is offline
    MemberRank
    Jan 2012 Join Date
    367Posts

    Re: @Myth Is this possible too?

    Quote Originally Posted by Iceslap View Post
    Code:
    int upperBound = Mobs.Count;
    for (int i = upperBound; i > 0; i--)
    {
        Mob mob = Mobs[i - 1];
        if (mob.ID == 0xA55 || mob.ID == 0xB00B1E5)
        {
            // do your secret code here
        }
    }
    @Myth
    Is this possible too or would this break your code?
    P.S. Thanks for the opcode, i will be adding this one to my emulator : )
    Ass and boobies make the world go round.

    Vote for Donald Trump.

  12. #12
    Enthusiast SlowLoris is offline
    MemberRank
    Mar 2016 Join Date
    31Posts

    Re: Zepheus check if mob equals id?

    @Myth
    How to spawn an NPC with C#.
    Code:
    /* I got this line from the Estrella github page. It's unfinished. Can you take a loot at it? */
    Npc npc = new Npc(spawn);



Advertisement