Welcome, guest! Please login or register.

    * Shoutbox

    RefreshHistory
    • ragnoroker: Brand new unique server just released! - Awesome Community - [link]
      October 14, 2019, 11:11:32 AM
    • ragnoroker: Brand new unique server just released! - Awesome Community - [link]
      October 14, 2019, 11:11:28 AM
    • ragnoroker: Brand new unique server just released! - Awesome Community - [link]
      October 14, 2019, 11:11:23 AM
    • marquise:[link]
      October 11, 2019, 12:24:21 PM
    • marquise: hey guys try autoscape.org [link]
      October 11, 2019, 12:19:08 PM
    • Rash: is this site still ded
      October 08, 2019, 07:54:22 PM
    • The Meek: Just Uploaded New Server ~Phusion~
      October 01, 2019, 03:30:31 AM
    • ragnoroker: Pre-EOC New server just dropped today! Come check it out :) - [link]
      September 27, 2019, 08:43:43 PM
    • ragnoroker: Pre-EOC New server just dropped today! Come check it out :) - [link]
      September 27, 2019, 08:43:40 PM
    • ragnoroker: Pre-EOC New server just dropped today! Come check it out :) - [link]
      September 27, 2019, 08:43:33 PM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 26, 2019, 09:02:13 AM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 26, 2019, 08:52:25 AM
    • ragnoroker: Brand new server! Join today - Good Eco/Nice Players - [link]
      September 25, 2019, 08:59:33 AM
    • ragnoroker: Brand new server! Join today - Good Eco/Nice Players - [link]
      September 25, 2019, 08:59:24 AM
    • ragnoroker: Brand new server! Join today - Good Eco/Nice Players - [link]
      September 25, 2019, 08:59:15 AM
    • PavSwag: bopalini
      September 23, 2019, 10:08:02 PM
    • PavSwag: Join autoscape,0rg fun events daily for infernal mystery boxes only server with Infernal Twisted Bow
      September 23, 2019, 03:05:33 PM
    • Frostydapure: Upcoming dmm/open pvp world server, 2006 style (different and fun trus me) [link] join join!
      September 23, 2019, 08:05:52 AM
    • Frostydapure: Upcoming dmm/open pvp world server, 2006 style (different and fun trus me) [link] join join!
      September 23, 2019, 08:05:45 AM
    • PavSwag: try autoscape,0rg today i will personally help you get RICH and well KNOWN - pav
      September 22, 2019, 02:55:32 PM

    Author Topic: Stuck on this variable!  (Read 2310 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