weclome to ic0de.ws Check here


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[C++ - Win32] Runescape special utility
#1
This is an old project that is full of errors; do not use it as something to learn from.

- Exp_Table.h
Code:
#ifndef EXPERIENCE_H
#define EXPERIENCE_H

int ExpLevels[] = {
  /* Level */
    /* 1 */  0,
    /* 2 */  83,
    /* 3 */  174,
    /* 4 */  276,
    /* 5 */  388,
    /* 6 */  512,
    /* 7 */  650,
    /* 8 */  801,
    /* 9 */  969,
    /* 10 */ 1154,
    /* 11 */ 1358,
    /* 12 */ 1584,
    /* 13 */ 1833,
    /* 14 */ 2107,
    /* 15 */ 2411,
    /* 16 */ 2746,
    /* 17 */ 3115,
    /* 18 */ 3523,
    /* 19 */ 3973,
    /* 20 */ 4470,
    /* 21 */ 5018,
    /* 22 */ 5624,
    /* 23 */ 6291,
    /* 24 */ 7028,
    /* 25 */ 7842,
    /* 26 */ 8740,
    /* 27 */ 9730,
    /* 28 */ 10824,
    /* 29 */ 12031,
    /* 30 */ 13363,
    /* 31 */ 14833,
    /* 32 */ 16456,
    /* 33 */ 18247,
    /* 34 */ 20224,
    /* 35 */ 22406,
    /* 36 */ 24815,
    /* 37 */ 27473,
    /* 38 */ 30408,
    /* 39 */ 33648,
    /* 40 */ 37224,
    /* 41 */ 41171,
    /* 42 */ 45529,
    /* 43 */ 50339,
    /* 44 */ 55649,
    /* 45 */ 61512,
    /* 46 */ 67983,
    /* 47 */ 75127,
    /* 48 */ 83014,
    /* 49 */ 91721,
    /* 50 */ 101333,
    /* 51 */ 111945,
    /* 52 */ 123660,
    /* 53 */ 136594,
    /* 54 */ 150872,
    /* 55 */ 166636,
    /* 56 */ 184040,
    /* 57 */ 203254,
    /* 58 */ 224466,
    /* 59 */ 247886,
    /* 60 */ 273742,
    /* 61 */ 302288,
    /* 62 */ 333804,
    /* 63 */ 368599,
    /* 64 */ 407015,
    /* 65 */ 449428,
    /* 66 */ 496254,
    /* 67 */ 547953,
    /* 68 */ 605032,
    /* 69 */ 668051,
    /* 70 */ 737627,
    /* 71 */ 814445,
    /* 72 */ 899257,
    /* 73 */ 992895,
    /* 74 */ 1096278,
    /* 75 */ 1210421,
    /* 76 */ 1336443,
    /* 77 */ 1475581,
    /* 78 */ 1629200,
    /* 79 */ 1798808,
    /* 80 */ 1986068,
    /* 81 */ 2192818,
    /* 82 */ 2421087,
    /* 83 */ 2673114,
    /* 84 */ 2951373,
    /* 85 */ 3258594,
    /* 86 */ 3597792,
    /* 87 */ 3972294,
    /* 88 */ 4385776,
    /* 89 */ 4842295,
    /* 90 */ 5346332,
    /* 91 */ 5902831,
    /* 92 */ 6517253,
    /* 93 */ 7195629,
    /* 94 */ 7944614,
    /* 95 */ 8771558,
    /* 96 */ 9684577,
    /* 97 */ 10692629,
    /* 98 */ 11805606,
    /* 99 */ 13034431
};

int ExpLevelsDiff[] = {

  /* Level Differences */

    /* 1 */ 0,
    /* 2 */ 83,
    /* 3 */ 91,
    /* 4 */ 102,
    /* 5 */ 112,
    /* 6 */ 124,
    /* 7 */ 138,
    /* 8 */ 151,
    /* 9 */ 168,
    /* 10 */ 185,
    /* 11 */ 204,
    /* 12 */ 226,
    /* 13 */ 249,
    /* 14 */ 274,
    /* 15 */ 304,
    /* 16 */ 335,
    /* 17 */ 369,
    /* 18 */ 408,
    /* 19 */ 450,
    /* 20 */ 497,
    /* 21 */ 548,
    /* 22 */ 606,
    /* 23 */ 667,
    /* 24 */ 737,
    /* 25 */ 814,
    /* 26 */ 898,
    /* 27 */ 990,
    /* 28 */ 1094,
    /* 29 */ 1207,
    /* 30 */ 1332,
    /* 31 */ 1470,
    /* 32 */ 1623,
    /* 33 */ 1791,
    /* 34 */ 1977,
    /* 35 */ 2182,
    /* 36 */ 2409,
    /* 37 */ 2658,
    /* 38 */ 2935,
    /* 39 */ 3240,
    /* 40 */ 3576,
    /* 41 */ 3947,
    /* 42 */ 4358,
    /* 43 */ 4810,
    /* 44 */ 5310,
    /* 45 */ 5863,
    /* 46 */ 6471,
    /* 47 */ 7144,
    /* 48 */ 7887,
    /* 49 */ 8707,
    /* 50 */ 9612,
    /* 51 */ 10612,
    /* 52 */ 11715,
    /* 53 */ 12934,
    /* 54 */ 14278,
    /* 55 */ 15764,
    /* 56 */ 17404,
    /* 57 */ 19214,
    /* 58 */ 21212,
    /* 59 */ 23420,
    /* 60 */ 25856,
    /* 61 */ 28546,
    /* 62 */ 31516,
    /* 63 */ 34795,
    /* 64 */ 38416,
    /* 65 */ 42413,
    /* 66 */ 46826,
    /* 67 */ 51699,
    /* 68 */ 57079,
    /* 69 */ 63019,
    /* 70 */ 69576,
    /* 71 */ 76818,
    /* 72 */ 84812,
    /* 73 */ 93638,
    /* 74 */ 103383,
    /* 75 */ 114143,
    /* 76 */ 126022,
    /* 77 */ 139138,
    /* 78 */ 153619,
    /* 79 */ 169608,
    /* 80 */ 187260,
    /* 81 */ 206750,
    /* 82 */ 228269,
    /* 83 */ 252027,
    /* 84 */ 278259,
    /* 85 */ 307221,
    /* 86 */ 339198,
    /* 87 */ 374502,
    /* 88 */ 413482,
    /* 89 */ 456519,
    /* 90 */ 504037,
    /* 91 */ 556499,
    /* 92 */ 614422,
    /* 93 */ 678376,
    /* 94 */ 748985,
    /* 95 */ 826944,
    /* 96 */ 913019,
    /* 97 */ 1008052,
    /* 98 */ 1112977,
    /* 99 */ 1228825
};

#endif


- fish.h
Code:
#ifndef FISH_H
#define FISH_H

void Fishing(const int ExpReq, const int Current,  long int Desired, const bool F2P) {

    /*
       Based on the current available fish you can fish,
       CheapestCatch will contain its value, and the
       highest value wins, and will be highlighted
    */

    int CheapestCatchID = 0;
    unsigned long int CheapestCatch = 4294967295;

    char *FishList[] = {
        "Shrimp",
        "Crayfish",
        "Sardine",
        "Herring",
        "Anchovy",
        "Trout",
        "Pike",
        "Salmon",
        "Tuna",
        "Lobster",
        "Swordfish",
        "Swordfish (gloves)",
        "Karambwanji",
        "Mackerel",
        "Cod",
        "Slimey Eel",
        "Frog Spawn",
        "Rainbowfish",
        "Cave Eel",
        "Bass",
        "Leaping Trout",
        "Lava Eel",
        "Tuna (Barb)",
        "Leaping Salmon",
        "Monkfish",
        "Karambwan",
        "Swordfish (Barb)",
        "Leaping Sturgeon",
        "Shark",
        "Sea Turtle",
        "Manta Ray",
        "Shark (gloves)",
        "Shark (Barb)"
    };

    PlaceCursor(0, 0);

    /* Save current cursor position */
    GetConsoleScreenBufferInfo(outHandle, &csbi);

    PlaceCursor(0, csbi.dwCursorPosition.Y); printf("LEVEL");
    PlaceCursor(10, csbi.dwCursorPosition.Y); printf("FISH TYPE");
    PlaceCursor(29, csbi.dwCursorPosition.Y); printf("EXPERIENCE");
    PlaceCursor(43, csbi.dwCursorPosition.Y); printf("AMOUNT REQUIRED");
    PlaceCursor(61, csbi.dwCursorPosition.Y); printf("LOADS REQUIRED");

    if (Current >= 1) {
        unsigned long int ShrimpExp = ExpReq / 10;

        SetColor(DARK_WHITE, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 2);  printf("1");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 2); printf("Shrimp");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 2); printf("10");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 2); printf("%ld", ShrimpExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 2); printf("%ld", ShrimpExp / 27);

        if (ShrimpExp < CheapestCatch) { CheapestCatch = ShrimpExp; CheapestCatchID = 0; }
    }

    if (Current >= 1) {
        unsigned long int CrayfishExp = ExpReq / 10;

        SetColor(GREY, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 3);  printf("1");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 3); printf("Crayfish");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 3); printf("10");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 3); printf("%ld", CrayfishExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 3); printf("%ld", CrayfishExp / 27);

        if (CrayfishExp < CheapestCatch) { CheapestCatch = CrayfishExp; CheapestCatchID = 1; }
    }


    if (Current >= 5) {
        unsigned long int SardineExp = ExpReq / 20;

        SetColor(DARK_WHITE, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 4);  printf("5"); // Level req.
        PlaceCursor(11, csbi.dwCursorPosition.Y + 4); printf("Sardine");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 4); printf("20"); // Experience
        PlaceCursor(45, csbi.dwCursorPosition.Y + 4); printf("%ld", SardineExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 4); printf("%ld", SardineExp / 27);

        if (SardineExp < CheapestCatch) { CheapestCatch = SardineExp; CheapestCatchID = 2; }
    }

    if (Current >= 10) {
        unsigned long int HerringExp = ExpReq / 30;

        SetColor(GREY, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 5);  printf("10");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 5); printf("Herring");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 5); printf("30");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 5); printf("%ld", HerringExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 5); printf("%ld", HerringExp / 27);

        if (HerringExp < CheapestCatch) { CheapestCatch = HerringExp; CheapestCatchID = 3; }
    }

    if (Current >= 15) {
        unsigned long int AnchovyExp = ExpReq / 40;

        SetColor(DARK_WHITE, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 6);  printf("15");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 6); printf("Anchovy");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 6); printf("40");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 6); printf("%ld", AnchovyExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 6); printf("%ld", AnchovyExp / 27);

        if (AnchovyExp < CheapestCatch) { CheapestCatch = AnchovyExp; CheapestCatchID = 4; }
    }

    if (Current >= 20) {
        unsigned long int TroutExp = ExpReq / 50;

        SetColor(GREY, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 7);  printf("20");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 7); printf("Trout");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 7); printf("50");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 7); printf("%ld", TroutExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 7); printf("%ld", TroutExp / 27);

        if (TroutExp < CheapestCatch) { CheapestCatch = TroutExp; CheapestCatchID = 5; }
    }

    if (Current >= 25) {
        unsigned long int PikeExp = ExpReq / 60;

        SetColor(DARK_WHITE, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 8);  printf("25");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 8); printf("Pike");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 8); printf("60");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 8); printf("%ld", PikeExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 8); printf("%ld", PikeExp / 27);

        if (PikeExp < CheapestCatch) { CheapestCatch = PikeExp; CheapestCatchID = 6; }
    }

    if (Current >= 30) {
        unsigned long int SalmonExp = ExpReq / 70;

        SetColor(GREY, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 9);  printf("30");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 9); printf("Salmon");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 9); printf("70");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 9); printf("%ld", SalmonExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 9); printf("%ld", SalmonExp / 27);

        if (SalmonExp < CheapestCatch) { CheapestCatch = SalmonExp; CheapestCatchID = 7; }
    }

    if (Current >= 35) {
        unsigned long int TunaExp = ExpReq / 80;

        SetColor(DARK_WHITE, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 10);  printf("35");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 10); printf("Tuna");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 10); printf("80");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 10); printf("%ld", TunaExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 10); printf("%ld", TunaExp / 27);

        if (TunaExp < CheapestCatch) { CheapestCatch = TunaExp; CheapestCatchID = 8; }
    }

    if (Current >= 40) {
        unsigned long int LobsterExp = ExpReq / 90;

        SetColor(GREY, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 11);  printf("40");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 11); printf("Lobsters");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 11); printf("90");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 11); printf("%ld", LobsterExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 11); printf("%ld", LobsterExp / 27);

        if (LobsterExp < CheapestCatch) { CheapestCatch = LobsterExp; CheapestCatchID = 9; }
    }

    if (Current >= 50) {
        unsigned long int SwordfishExp = ExpReq / 100;

        SetColor(DARK_WHITE, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 12);  printf("50");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 12); printf("Swordfish");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 12); printf("100");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 12); printf("%ld", SwordfishExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 12); printf("%ld", SwordfishExp / 27);

        if (SwordfishExp < CheapestCatch) { CheapestCatch = SwordfishExp; CheapestCatchID = 10; }
    }

    if (Current >= 65) {
        unsigned long int SwordfishGloveExp = ExpReq / 200;

        SetColor(GREY, BLACK);
        PlaceCursor(1, csbi.dwCursorPosition.Y + 13);  printf("65");
        PlaceCursor(11, csbi.dwCursorPosition.Y + 13); printf("Swordfish (gloves)");
        PlaceCursor(33, csbi.dwCursorPosition.Y + 13); printf("200");
        PlaceCursor(45, csbi.dwCursorPosition.Y + 13); printf("%ld", SwordfishGloveExp);
        PlaceCursor(64, csbi.dwCursorPosition.Y + 13); printf("%ld\n\n", SwordfishGloveExp / 27);

        if (SwordfishGloveExp < CheapestCatch) { CheapestCatch = SwordfishGloveExp; CheapestCatchID = 11; }
    }

Code:
/** MEMBERS ONLY BELOW **/



    if (!F2P) {

  SetColor(BLACK, RED);

  PlaceCursor(0, csbi.dwCursorPosition.Y + 15);

  printf("    (MEMBERS ONLY)    ");



  if (Current >= 5) {

    unsigned long int KarambwanjiExp = ExpReq / 5;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 17);  printf("5");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 17); printf("Karambwanji");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 17); printf("5");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 17); printf("%ld", KarambwanjiExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 17); printf("%ld", KarambwanjiExp / 27);



    if (KarambwanjiExp < CheapestCatch) { CheapestCatch = KarambwanjiExp; CheapestCatchID = 12; }

  }



  if (Current >= 16) {

    unsigned long int MackerelExp = ExpReq / 20;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 18);  printf("16");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 18); printf("Mackerel");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 18); printf("20");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 18); printf("%ld", MackerelExp );

    PlaceCursor(64, csbi.dwCursorPosition.Y + 18); printf("%ld", MackerelExp  / 27);



    if (MackerelExp < CheapestCatch) { CheapestCatch = MackerelExp; CheapestCatchID = 13; }

  }



  if (Current >= 23) {

    unsigned long int CodExp = ExpReq / 45;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 19);  printf("23");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 19); printf("Cod");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 19); printf("45");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 19); printf("%ld", CodExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 19); printf("%ld", CodExp / 27);



    if (CodExp < CheapestCatch) { CheapestCatch = CodExp; CheapestCatchID = 14; }

  }



  if (Current >= 28) {

    unsigned long int SlimeyEelExp = ExpReq / 65;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 20);  printf("28");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 20); printf("Slimey Eel");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 20); printf("65");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 20); printf("%ld", SlimeyEelExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 20); printf("%ld", SlimeyEelExp / 27);



    if (SlimeyEelExp < CheapestCatch) { CheapestCatch = SlimeyEelExp; CheapestCatchID = 15; }

  }



  if (Current >= 33) {

    unsigned long int FrogSpawnExp = ExpReq / 75;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 21);  printf("33");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 21); printf("Frog Spawn");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 21); printf("75");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 21); printf("%ld", FrogSpawnExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 21); printf("%ld", FrogSpawnExp / 27);



    if (FrogSpawnExp < CheapestCatch) { CheapestCatch = FrogSpawnExp; CheapestCatchID = 16; }

  }



  if (Current >= 38) {

    unsigned long int RainbowfishExp = ExpReq / 80;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 22);  printf("38");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 22); printf("Rainbowfish");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 22); printf("80");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 22); printf("%ld", RainbowfishExp);

    PlaceCursor(

    64, csbi.dwCursorPosition.Y + 22); printf("%ld", RainbowfishExp / 27);



    if (RainbowfishExp < CheapestCatch) { CheapestCatch = RainbowfishExp; CheapestCatchID = 17; }

  }



  if (Current >= 38) {

    unsigned long int CaveEelExp = ExpReq / 80;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 23);  printf("38");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 23); printf("Cave Eel");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 23); printf("80");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 23); printf("%ld", CaveEelExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 23); printf("%ld", CaveEelExp / 27);



    if (CaveEelExp < CheapestCatch) { CheapestCatch = CaveEelExp; CheapestCatchID = 18; }

  }



  if (Current >= 46) {

    unsigned long int BassExp = ExpReq / 100;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 24);  printf("46");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 24); printf("Bass");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 24); printf("100");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 24); printf("%ld", BassExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 24); printf("%ld", BassExp / 27);



    if (BassExp < CheapestCatch) { CheapestCatch = BassExp; CheapestCatchID = 19; }

  }



  if (Current >= 48) {

    unsigned long int LeapingTroutExp = ExpReq / 50;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 25);  printf("48");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 25); printf("Leaping Trout");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 25); printf("50");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 25); printf("%ld", LeapingTroutExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 25); printf("%ld", LeapingTroutExp / 27);



    if (LeapingTroutExp < CheapestCatch) { CheapestCatch = LeapingTroutExp; CheapestCatchID = 20; }

  }



  if (Current >= 53) {

    unsigned long int LavaEelExp = ExpReq / 60;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 26);  printf("53");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 26); printf("Lava Eel");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 26); printf("60");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 26); printf("%ld", LavaEelExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 26); printf("%ld", LavaEelExp / 27);



    if (LavaEelExp < CheapestCatch) { CheapestCatch = LavaEelExp; CheapestCatchID = 21; }

  }



  if (Current >= 55) {

    unsigned long int Tuna_BarbarianExp = ExpReq / 80;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 27);  printf("55");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 27); printf("Tuna (Barb)");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 27); printf("80");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 27); printf("%ld", Tuna_BarbarianExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 27); printf("%ld", Tuna_BarbarianExp / 27);



    if (Tuna_BarbarianExp < CheapestCatch) { CheapestCatch = Tuna_BarbarianExp; CheapestCatchID = 22; }

  }



  if (Current >= 58) {

    unsigned long int LeapingSalmonExp = ExpReq / 70;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 28);  printf("58");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 28); printf("Leaping Salmon");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 28); printf("70");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 28); printf("%ld", LeapingSalmonExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 28); printf("%ld", LeapingSalmonExp / 27);



    if (LeapingSalmonExp < CheapestCatch) { CheapestCatch = LeapingSalmonExp; CheapestCatchID = 23; }

  }



  if (Current >= 62) {

    unsigned long int MonkfishExp = ExpReq / 120;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 29);  printf("62");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 29); printf("Monkfish");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 29); printf("120");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 29); printf("%ld", MonkfishExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 29); printf("%ld", MonkfishExp / 27);



    if (MonkfishExp < CheapestCatch) { CheapestCatch = MonkfishExp; CheapestCatchID = 24; }

  }



  if (Current >= 65) {

    unsigned long int KarambwanExp = ExpReq / 105;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 30);  printf("65");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 30); printf("Karambwan");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 30); printf("105");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 30); printf("%ld", KarambwanExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 30); printf("%ld", KarambwanExp / 27);



    if (KarambwanExp < CheapestCatch) { CheapestCatch = KarambwanExp; CheapestCatchID = 25; }

  }



  if (Current >= 65) {

    unsigned long int LeapingSturgeonExp = ExpReq / 80;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 31);  printf("65");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 31); printf("Leaping Sturgeon");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 31); printf("80");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 31); printf("%ld", LeapingSturgeonExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 31); printf("%ld", LeapingSturgeonExp / 27);



    if (LeapingSturgeonExp < CheapestCatch) { CheapestCatch = LeapingSturgeonExp; CheapestCatchID = 26; }

  }



  if (Current >= 70) {

    unsigned long int Swordfish_Barbarian = ExpReq / 100;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 32);  printf("70");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 32); printf("Swordfish (Barb)");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 32); printf("100");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 32); printf("%ld", Swordfish_Barbarian);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 32); printf("%ld", Swordfish_Barbarian / 27);



    if (Swordfish_Barbarian < CheapestCatch) { CheapestCatch = Swordfish_Barbarian; CheapestCatchID = 27; }

  }



  if (Current >= 76) {

    unsigned long int SharkExp = ExpReq / 110;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 33);  printf("76");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 33); printf("Shark");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 33); printf("110");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 33); printf("%ld", SharkExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 33); printf("%ld", SharkExp / 27);



    if (SharkExp < CheapestCatch) { CheapestCatch = SharkExp; CheapestCatchID = 28; }

  }



  if (Current >= 79) {

    unsigned long int SeaTurtleExp = ExpReq / 38;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 34);  printf("79");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 34); printf("Sea Turtle");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 34); printf("38");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 34); printf("%ld", SeaTurtleExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 34); printf("%ld", SeaTurtleExp / 27);



    if (SeaTurtleExp < CheapestCatch) { CheapestCatch = SeaTurtleExp; CheapestCatchID = 29; }

  }



  if (Current >= 81) {

    unsigned long int MantaRayExp = ExpReq / 46;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 35);  printf("81");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 35); printf("Manta Ray");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 35); printf("46");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 35); printf("%ld", MantaRayExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 35); printf("%ld", MantaRayExp / 27);



    if (MantaRayExp < CheapestCatch) { CheapestCatch = MantaRayExp; CheapestCatchID = 30; }

  }



  if (Current >= 90) {

    unsigned long int SharkGlovesExp = ExpReq / 210;



    SetColor(GREY, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 36);  printf("90");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 36); printf("Shark (gloves)");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 36); printf("210");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 36); printf("%ld", SharkGlovesExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 36); printf("%ld", SharkGlovesExp / 27);



    if (SharkGlovesExp < CheapestCatch) { CheapestCatch = SharkGlovesExp; CheapestCatchID = 31; }

  }



  if (Current >= 96) {

    unsigned long int Shark_BarbarianExp = ExpReq / 110;



    SetColor(DARK_WHITE, BLACK);

    PlaceCursor(1, csbi.dwCursorPosition.Y + 37);  printf("96");

    PlaceCursor(11, csbi.dwCursorPosition.Y + 37); printf("Shark (Barb)");

    PlaceCursor(33, csbi.dwCursorPosition.Y + 37); printf("110");

    PlaceCursor(45, csbi.dwCursorPosition.Y + 37); printf("%ld", Shark_BarbarianExp);

    PlaceCursor(64, csbi.dwCursorPosition.Y + 37); printf("%ld", Shark_BarbarianExp / 27);



    if (Shark_BarbarianExp < CheapestCatch) { CheapestCatch = Shark_BarbarianExp; CheapestCatchID = 32; }

  }

    }



    SetColor(BLACK, RED);

    printf("\n\nCheapestCatch: %s - %d", FishList[CheapestCatchID], CheapestCatchID);



    return;

}



#endif

- main.cpp
Code:
#include <iostream>
#include <TextControl.h>
using namespace std;

HANDLE outHandle = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_SCREEN_BUFFER_INFO csbi;

enum Skills {
    HITPOINTS = 0,
    ATTACK = 1,
    MINING = 2,
    STRENGTH = 3,
    AGILITY = 4,
    SMITHING = 5,
    DEFENSE = 6,
    HERBLORE = 7,
    FISHING = 8,
    RANGED = 9,
    THIEVING = 10,
    COOKING = 11,
    PRAYER = 12,
    CRAFTING = 13,
    FIREMAKING = 14,
    MAGIC = 15,
    FLETCHING = 16,
    WOODCUTTING = 17,
    RUNECRAFTING = 18,
    SLAYER = 19,
    FARMING = 20,
    CONSTRUCTION = 21,
    HUNTER = 22,
    SUMMONING = 23
};

#include "Exp_Table.h"
#include "Fish.h"

int main() {

    Skills SkillType = HITPOINTS;

    int MemberType = 0;

    int lRatio = 0;
    int rRatio = 0;
    int ForumGold = 0;

    int Current = 0;
    int Desired = 0;

    int TotalExp = 0;
    int ExpReq = 0;

    int Temp = 0;

    printf("1. Members (P2P)\t2. Non-members (F2P)\n"
    "Enter member type: ");
    scanf("%d", &MemberType);
    MemberType--;

    ClearConsole(GREY, BLACK);
    PlaceCursor(0, 0);

    printf("Skill Types:\n"
    "1.  Attack\t2.  Mining\t3.  Strength\t4.  Agility\t5.  Smithing\n"
    "6.  Defense\t7.  Herblore\t8.  Fishing\t9.  Ranged\t10. Thieving\n"
    "11. Cooking\t12. Prayer\t13. Crafting\t14. Firemaking\t15. Magic\n"
    "16. Fletching\t17. Woodcutting\t18. Slayer\t19. Runecrafting\t\n"
    "20. Farming\t21. Hunter\t22. Summoning\t23. Construction\n\n"
    "Enter skill type: ");
    scanf("%d", &Temp);

    switch (Temp) {
        case MAGIC:        { SkillType = MAGIC;        } break;
        case HUNTER:       { SkillType = HUNTER;       } break;
        case ATTACK:       { SkillType = ATTACK;       } break;
        case MINING:       { SkillType = MINING;       } break;
        case RANGED:       { SkillType = RANGED;       } break;
        case SLAYER:       { SkillType = SLAYER;       } break;
        case PRAYER:       { SkillType = PRAYER;       } break;
        case FARMING:      { SkillType = FARMING;      } break;
        case FISHING:      { SkillType = FISHING;      } break;
        case AGILITY:      { SkillType = AGILITY;      } break;
        case DEFENSE:      { SkillType = DEFENSE;      } break;
        case COOKING:      { SkillType = COOKING;      } break;
        case STRENGTH:     { SkillType = STRENGTH;     } break;
        case SMITHING:     { SkillType = SMITHING;     } break;
        case HERBLORE:     { SkillType = HERBLORE;     } break;
        case CRAFTING:     { SkillType = CRAFTING;     } break;
        case THIEVING:     { SkillType = THIEVING;     } break;
        case FLETCHING:    { SkillType = FLETCHING;    } break;
        case SUMMONING:    { SkillType = SUMMONING;    } break;
        case FIREMAKING:   { SkillType = FIREMAKING;   } break;
        case WOODCUTTING:  { SkillType = WOODCUTTING;  } break;
        case RUNECRAFTING: { SkillType = RUNECRAFTING; } break;
        case CONSTRUCTION: { SkillType = CONSTRUCTION; } break;
    }


    /* Levels */
    printf("\nCurrent level (1-99): "); scanf("%d", &Current);
    printf("Desired level (1-99): "); scanf("%d", &Desired);

    /* Forum gold ratio */
    printf("Forum gold (left side of the ratio): "); scanf("%d", &lRatio);
    printf("Experience (right side of the ratio): "); scanf("%d", &rRatio);

    for (int x = Current; x < Desired; x++) {
        TotalExp += ExpLevels[x];
        ExpReq += ExpLevelsDiff[x];
    }

    ClearConsole(BLACK, BLACK);
    PlaceCursor(0, 0);

    SetColor(WHITE, BLACK);

    switch (SkillType) {

        case HITPOINTS:    { } break;
        case MAGIC:        { } break;
        case HUNTER:       { } break;
        case ATTACK:       { } break;
        case MINING:       { } break;
        case RANGED:       { } break;
        case SLAYER:       { } break;
        case PRAYER:       { } break;
        case FARMING:      { } break;
        case AGILITY:      { } break;
        case DEFENSE:      { } break;
        case COOKING:      { } break;
        case STRENGTH:     { } break;
        case SMITHING:     { } break;
        case HERBLORE:     { } break;
        case CRAFTING:     { } break;
        case THIEVING:     { } break;
        case FLETCHING:    { } break;
        case SUMMONING:    { } break;
        case FIREMAKING:   { } break;
        case WOODCUTTING:  { } break;
        case RUNECRAFTING: { } break;
        case CONSTRUCTION: { } break;

        case FISHING: { Fishing(ExpReq, Current, Desired, MemberType); } break;
    }

    /* Base experience */
    SetColor(WHITE, BLACK); printf("\nBase experience ");
    SetColor(GREY); printf("(level: %d): ", Current);
    SetColor(CYAN); printf("%d\n", ExpLevels[Current - 1]);

    /* Target experience */
    SetColor(WHITE, BLACK); printf("Target experience ");
    SetColor(GREY); printf("(level: %d): ", Desired);
    SetColor(CYAN); printf("%d\n", ExpLevels[Desired - 1]);

    /* Experience difference */
    SetColor(RED, BLACK); printf("Difference of: ");
    SetColor(CYAN); printf("%d\n\n", (ExpLevels[Desired - 1] - ExpLevels[Current - 1]));

    /* Calculate forum gold ratio (x:x ratio) */
    SetColor(WHITE, BLACK);
    ForumGold = (((ExpLevels[Desired - 1] - ExpLevels[Current - 1]) / rRatio)) * lRatio;
    printf("The ratio is %d:%d and the total forum gold is: %d\n\n", lRatio, rRatio, ForumGold);

    SetColor(BLACK, BLACK);
    _flushall();
    cin.get();
    return 0;
}
Discord moderator
Reply
#2
Looks nice I'll try modifying the source snips and try running them when I'm free!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)