Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • hardcore22: are there any kind of silabsoft servers like back in the days i miss that
      May 25, 2020, 05:44:08 AM
    • Amcora: @ dr house contact me; greetings celien :)
      May 24, 2020, 03:16:21 PM
    • Amcora: Stop shouting around please
      May 24, 2020, 03:13:26 PM
    • iddsyou: PkOwnage OSRSPS [link]  Join us on Discord! [link]  Download: [link]
      May 17, 2020, 11:44:17 AM
    • Decimate Returns: PROJECT DECIMATE RETURNS !! 300+ PLAYERS BACK IN 2012 - NOW WITH ALOT OF UPDATES ! JOIN NOW! [link]
      May 17, 2020, 02:48:19 AM
    • Decimate Returns: PROJECT DECIMATE RETURNS !! 300+ PLAYERS BACK IN 2012 - NOW WITH ALOT OF UPDATES ! JOIN NOW! [link]
      May 17, 2020, 02:48:12 AM
    • Decimate Returns: PROJECT DECIMATE RETURNS !! 300+ PLAYERS BACK IN 2012 - NOW WITH ALOT OF UPDATES ! JOIN NOW! [link]
      May 17, 2020, 02:47:56 AM
    • Decimate Returns: PROJECT DECIMATE RETURNS !! 300+ PLAYERS BACK IN 2012 - NOW WITH ALOT OF UPDATES ! JOIN NOW! [link]
      May 17, 2020, 02:47:49 AM
    • Decimate Returns: PROJECT DECIMATE RETURNS !! 300+ PLAYERS BACK IN 2012 - NOW WITH ALOT OF UPDATES ! JOIN NOW! [link]
      May 17, 2020, 02:47:42 AM
    • Decimate Returns: PROJECT DECIMATE RETURNS !! 300+ BACK IN 2012 - NOW WITH ALOT OF UPDATES ! JOIN NOW! [link]
      May 17, 2020, 02:47:29 AM
    • ragnoroker: BRAND NEW SERVER - PRE EOC - UNIQUE - JOIN TODAY :) - [link]
      May 15, 2020, 11:18:03 AM
    • ragnoroker: BRAND NEW SERVER - PRE EOC - UNIQUE - JOIN TODAY :) - [link]
      May 15, 2020, 11:17:53 AM
    • ragnoroker: BRAND NEW SERVER - PRE EOC - UNIQUE - JOIN TODAY :) - [link]
      May 15, 2020, 11:17:50 AM
    • Decimate Returns: Project Decimate 474 OSRS ; [link]
      May 13, 2020, 07:27:00 PM
    • hardcore22: are there any silabsoft servers left? of the good old days like hackscape
      May 12, 2020, 07:53:18 AM
    • iddsyou: yo guys check out this instagram post #pkownage  [link]
      May 06, 2020, 02:35:58 PM
    • fishingsheep: any servers like project catasrophe or frugoo scape been remade ?
      May 04, 2020, 05:01:00 PM
    • asshole_rule: relmitos the legend
      May 04, 2020, 04:28:54 PM
    • iddsyou: PkOwnage 317 OSRS, Vote4donor, [link] Download now: [link] Discord: [link]
      May 04, 2020, 11:15:11 AM
    • relmitos: is anyone familiar with 317 packet opcodes? Im confused about opcode 3 (wich appears to send wether or not the client window is currently focused). is it safe to ignore?
      May 03, 2020, 08:47:40 AM

    Author Topic: Stuck on this variable!  (Read 2476 times)

    0 Members and 1 Guest are viewing this topic.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Stuck on this variable!
    « on: December 14, 2015, 07:06:17 PM »
    So... I keep getting this error with this variable I know I need to declare it but it seems i'm not finding the right spot i tried to declare it inside of combatAssistance but it's still not fixing the error any help would be nice..

    Code: [Select]
    public static void attackPlayer(Client c, int i) {
    if (PlayerHandler.players[i] != null) {
    strBonus = c.playerBonus[10];
    if (PlayerHandler.players[i].isDead) {
    c.getCombat().resetPlayerAttack();
    return;
    }
    Runescape Gambling

    OfflinexXSh0ckXx

    • Member
    • ****
    • Posts: 642
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #1 on: December 14, 2015, 07:53:10 PM »
    in your method change
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. strBonus = c.playerBonus[10];
    to
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. int strBonus = c.playerBonus[10];
    Drop me a pm.

    They got money for wars, but can't feed the poors. - Tupac Shakur
    Old, but Gold.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #2 on: December 14, 2015, 08:12:34 PM »
    in your method change
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. strBonus = c.playerBonus[10];
    to
    Code: Java(TM) 2 Platform Standard Edition 5.0
    1. int strBonus = c.playerBonus[10];

    Alright I fixed that, thank you! But i'm having some problems here the main reason I was putting that in there is because when I switch from a bronze scim to a higher item such as ags the scim would hit as high as the ags the combat is calculated wrong i'm needing help with this iv'e tried different tutorials and none seem to be right on point! What is the cause of this non sense.

    OfflineEyeownyew

    • Member
    • ****
    • Posts: 3,431
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #3 on: December 14, 2015, 10:07:13 PM »
    check under calculateMeleeMaxHit, not attackPlayer

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #4 on: December 14, 2015, 10:16:23 PM »
    check under calculateMeleeMaxHit, not attackPlayer

    Here's the coding I have
    Code: [Select]
    public class MeleeMaxHit {

    public static double calculateBaseDamage(Client c, boolean special) {

    double base = 0;
    int attBonus = c.playerBonus[10]; //attack
    int attack = c.playerLevel[0]; //attack
    // int strBonus = c.playerBonus[10]; //strength
    int strength = c.playerLevel[2]; //strength
    int defBonus = c.playerBonus[10]; //defense
    int defense = c.playerLevel[1]; //defense
    int attlvlForXP = c.getLevelForXP(c.playerXP[0]); //attack
    int strlvlForXP = c.getLevelForXP(c.playerXP[2]); //strength
    int deflvlForXP = c.getLevelForXP(c.playerXP[1]); //defense
    int lvlForXP = c.getLevelForXP(c.playerXP[2]);
     
    double effective = getEffectiveStr(c);
    double specialBonus = getSpecialStr(c);
    double strengthBonus = c.playerBonus[10];

    base = (13 + effective + (strengthBonus / 8) + ((effective * strengthBonus) / 64)) / 10;

    if(c.playerEquipment[c.playerWeapon] == 4718 && c.playerEquipment[c.playerHat] == 4716 && c.playerEquipment[c.playerChest] == 4720 && c.playerEquipment[c.playerLegs] == 4722) {
    base += (c.getPA().getLevelForXP(c.playerXP[3]) - c.playerLevel[3]) / 2;
    c.usingSpecial = false;
    }

    if (c.usingSpecial) {
    base = (base * specialBonus);
    }
    if (hasObsidianEffect(c) || hasVoid(c)) {
    base = (base * 1.2);
    }
    if(c.prayerActive[1]) {
    strength += (int)(lvlForXP * .05);
    } else
    if(c.prayerActive[6]) {
    strength += (int)(lvlForXP * .1);
    } else
    if(c.prayerActive[14]) {
    strength += (int)(lvlForXP * .15);
    } else
    if(c.prayerActive[24]) {
    strength += (int)(lvlForXP * .18);
    } else
    if(c.prayerActive[25]) {
    strength += (int)(lvlForXP * .23);
    }
    return Math.floor(base);
    }

    public static double getEffectiveStr(Client c) {
    return ((c.playerLevel[2]) * getPrayerStr(c)) + getStyleBonus(c);
    }

    OfflineSoulxs

    • Member
    • ***
    • Posts: 131
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #5 on: December 14, 2015, 11:20:28 PM »
    Probably nothing to do with maxhit, try to see if the characrer updates upon wielding a new weapon.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #6 on: December 14, 2015, 11:55:33 PM »
    Probably nothing to do with maxhit, try to see if the characrer updates upon wielding a new weapon.

    So I found this it may be useful if this helps.

    Code: [Select]
    /**
    * Updates the slot when wielding an item.
    *
    * @param slot
    */
    public void updateSlot(int slot) {
    synchronized (c) {
    if (c.getOutStream() != null && c != null) {
    c.getOutStream().createFrameVarSizeWord(34);
    c.getOutStream().writeWord(1688);
    c.getOutStream().writeByte(slot);
    c.getOutStream().writeWord(c.playerEquipment[slot] + 1);
    if (c.playerEquipmentN[slot] > 254) {
    c.getOutStream().writeByte(255);
    c.getOutStream().writeDWord(c.playerEquipmentN[slot]);
    } else {
    c.getOutStream().writeByte(c.playerEquipmentN[slot]);
    }
    c.getOutStream().endFrameVarSizeWord();
    c.flushOutStream();
    }
    }

    }

    /**
    * Removes a wielded item.
    **/
    public void removeItem(int wearID, int slot) {
    // synchronized(c) {
    if (c.getOutStream() != null && c != null) {
    if (c.playerEquipment[slot] > -1) {
    if (addItem(c.playerEquipment[slot], c.playerEquipmentN[slot])) {
    c.playerEquipment[slot] = -1;
    c.playerEquipmentN[slot] = 0;
    sendWeapon(c.playerEquipment[c.playerWeapon],
    getItemName(c.playerEquipment[c.playerWeapon]));
    resetBonus();
    getBonus();
    writeBonus();
    c.getCombat().getPlayerAnimIndex(
    c.getItems()
    .getItemName(
    c.playerEquipment[c.playerWeapon])
    .toLowerCase());
    c.getOutStream().createFrame(34);
    c.getOutStream().writeWord(6);
    c.getOutStream().writeWord(1688);
    c.getOutStream().writeByte(slot);
    c.getOutStream().writeWord(0);
    c.getOutStream().writeByte(0);
    c.flushOutStream();
    c.updateRequired = true;
    c.setAppearanceUpdateRequired(true);
    c.isFullHelm = Item
    .isFullHelm(c.playerEquipment[c.playerHat]);
    c.isFullMask = Item
    .isFullMask(c.playerEquipment[c.playerHat]);
    c.isFullBody = Item
    .isFullBody(c.playerEquipment[c.playerChest]);
    }
    }
    }
    // }
    }

    OfflineEyeownyew

    • Member
    • ****
    • Posts: 3,431
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #7 on: December 15, 2015, 08:16:28 AM »
    tank, do you see this..?

    Code: [Select]
    // int strBonus = c.playerBonus[10]; //strength
    you have to inspect your own code dude.

    The strength bonus is commented out. That grabs the player bonus, strength bonus, when calculating max hits. It's not updating because it's commented out.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #8 on: December 15, 2015, 04:21:07 PM »
    tank, do you see this..?

    Code: [Select]
    // int strBonus = c.playerBonus[10]; //strength
    you have to inspect your own code dude.

    The strength bonus is commented out. That grabs the player bonus, strength bonus, when calculating max hits. It's not updating because it's commented out.

    Yeah i'm the one who did that lol but even when its uncommented still have that same problem.

    OfflineEyeownyew

    • Member
    • ****
    • Posts: 3,431
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #9 on: December 15, 2015, 05:56:25 PM »
    yes, because it's not utilized anywhere.

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #10 on: December 16, 2015, 01:51:28 AM »
    yes, because it's not utilized anywhere.

    What do you mean? Be more specific as to what you are saying please.

    OfflineTree

    • Member
    • ****
    • Posts: 2,638
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #11 on: December 16, 2015, 05:10:50 AM »
    yes, because it's not utilized anywhere.

    What do you mean? Be more specific as to what you are saying please.

    I suggest you do a bit of reading up on Java.
    You're going to have a difficult time if you're unsure what commenting does, or how variables work.

    Reading: https://docs.oracle.com/javase/tutorial/reallybigindex.html
    Quote
    <_^_> this community has really collapsed
    <_^_> it is like a shitty version of friendster for washed up nerds

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #12 on: December 17, 2015, 10:56:59 AM »
    yes, because it's not utilized anywhere.

    What do you mean? Be more specific as to what you are saying please.

    I suggest you do a bit of reading up on Java.
    You're going to have a difficult time if you're unsure what commenting does, or how variables work.

    Reading: https://docs.oracle.com/javase/tutorial/reallybigindex.html

    What are you talking about, I never said I don't know what commenting does or how variables work... Commenting something out basically its like you deleted it or it was never there, and variables declare things in your code. No one said anything about that but thanks for the reply!

    OfflineJustin Bieber

    • Member
    • ****
    • Posts: 2,941
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #13 on: December 17, 2015, 03:35:13 PM »
    sweet jesus, i've seen you posting questions here for over a year and you're still copypasting with no idea how the basics work. go read a book fml

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #14 on: December 18, 2015, 11:33:05 AM »
    sweet jesus, i've seen you posting questions here for over a year and you're still copypasting with no idea how the basics work. go read a book fml

    Copy and paste, i don't understand what the hell you guys are talking about i asked a question no one answered anything all i'm asking is for a lead on what i should do here... i never copied and pasted anything its called "quote"!

    OfflineSoulxs

    • Member
    • ***
    • Posts: 131
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #15 on: December 18, 2015, 02:29:14 PM »
    You basicly ask for a spoonfeed in every thread you make. I started out like that but believe me, you wont learn anything from it. Just try to work it out for yourself, when you think you are on to something but got stuck post the cose and possible errors. Thats way more usefull then waiting for a spoonfeed.

    OfflineX-J-K-X

    • Member
    • ****
    • Posts: 1,951
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #16 on: December 19, 2015, 05:44:38 AM »
    sweet jesus, i've seen you posting questions here for over a year and you're still copypasting with no idea how the basics work. go read a book fml

    Copy and paste, i don't understand what the hell you guys are talking about i asked a question no one answered anything all i'm asking is for a lead on what i should do here... i never copied and pasted anything its called "quote"!

    You have been given the answer in this thread several times.

    The variable is not found.

    OfflineJustin Bieber

    • Member
    • ****
    • Posts: 2,941
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #17 on: December 19, 2015, 10:28:08 AM »
    sweet jesus, i've seen you posting questions here for over a year and you're still copypasting with no idea how the basics work. go read a book fml

    Copy and paste, i don't understand what the hell you guys are talking about i asked a question no one answered anything all i'm asking is for a lead on what i should do here... i never copied and pasted anything its called "quote"!
    because you're just trying random shit people give you until you get something that works. you're not trying to understand the flow or design of the code, or what the syntax actually means, you're just posting errors and asking how to fix them. shit rsps tutorials aren't going to help you either, you need to just take a couple of hours learning the pure simple basics of java.

    i'm all for a bit of spoonfeeding, it's annoying when you're asking how to do something new and people keep getting pissy because you're inexperienced, but this is obscene. you're making no effort.
    « Last Edit: December 19, 2015, 10:31:13 AM by Justin Bieber »

    Offlinetank nation

    • Member
    • ****
    • Posts: 483
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #18 on: December 19, 2015, 02:01:26 PM »
    sweet jesus, i've seen you posting questions here for over a year and you're still copypasting with no idea how the basics work. go read a book fml

    Copy and paste, i don't understand what the hell you guys are talking about i asked a question no one answered anything all i'm asking is for a lead on what i should do here... i never copied and pasted anything its called "quote"!
    because you're just trying random shit people give you until you get something that works. you're not trying to understand the flow or design of the code, or what the syntax actually means, you're just posting errors and asking how to fix them. shit rsps tutorials aren't going to help you either, you need to just take a couple of hours learning the pure simple basics of java.

    i'm all for a bit of spoonfeeding, it's annoying when you're asking how to do something new and people keep getting pissy because you're inexperienced, but this is obscene. you're making no effort.

    I'm am willing to learn do you have any type of sites i can go to so i can actually learn (Basics of java) Cause i honestly know more then you think, i never copied anyone's tutorial at all on here. I'm not complaining or asking for any type of answers just where i can look so i can find where my problem lies.

    OfflineJustin Bieber

    • Member
    • ****
    • Posts: 2,941
    • Thanks: +0/-0
      • View Profile
    Re: Stuck on this variable!
    « Reply #19 on: December 19, 2015, 02:49:06 PM »
    sweet jesus, i've seen you posting questions here for over a year and you're still copypasting with no idea how the basics work. go read a book fml

    Copy and paste, i don't understand what the hell you guys are talking about i asked a question no one answered anything all i'm asking is for a lead on what i should do here... i never copied and pasted anything its called "quote"!
    because you're just trying random shit people give you until you get something that works. you're not trying to understand the flow or design of the code, or what the syntax actually means, you're just posting errors and asking how to fix them. shit rsps tutorials aren't going to help you either, you need to just take a couple of hours learning the pure simple basics of java.

    i'm all for a bit of spoonfeeding, it's annoying when you're asking how to do something new and people keep getting pissy because you're inexperienced, but this is obscene. you're making no effort.

    I'm am willing to learn do you have any type of sites i can go to so i can actually learn (Basics of java) Cause i honestly know more then you think, i never copied anyone's tutorial at all on here. I'm not complaining or asking for any type of answers just where i can look so i can find where my problem lies.
    when i started learning java properly i watched these stanford cs lectures



    it was a breath of fresh air actually having someone explain this shit, instead of trying to learn backwards mashing together whatever bits of code work. iirc it starts off explaining what programming is all about so you might want to skip a few. also i recommend having a bag of sweets/chocolates so u can treat yourself when he throws them out. there are loads of good java books if u don't like videos, just check your local library.

     

    Copyright © 2017 MoparScape. All rights reserved.
    Powered by SMFPacks SEO Pro Mod |
    SimplePortal 2.3.5 © 2008-2012, SimplePortal