• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Help needed with Game script

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


These are the resulting errors


Scripts\Sources\ColdShaadowGrenWall.java:106: error: no suitable method found for setVisible()
gui.setVisible();
^
method JComponent.setVisible(boolean) is not applicable
(actual and formal argument lists differ in length)
Scripts\Sources\ColdShaadowGrenWall.java:174: error: cannot find symbol
walking.walkPathMM(path);
^
symbol: method walkPathMM(RSTile[])
location: variable walking of type Walking
Scripts\Sources\ColdShaadowGrenWall.java:180: error: cannot find symbol
int spikePrice = grandExchange.lookup(spikeID).getMarketPrice();
^
symbol: method getMarketPrice()
location: class GEItem
Scripts\Sources\ColdShaadowGrenWall.java:202: error: reference to getItem is ambiguous, both method getItem(int...) in Inventory and method getItem(String...) in Inventory match
inventory.getItem().doAction("Eat");



Can somebody tell me how to fix this? I feel as though this should be a simple fix.
 
Jeremy T Anderson
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In case it isn't painfully obvious, I'm really new to this. I found this script posted publicly, so I thought I'd try my hand at it.
 
Ranch Hand
Posts: 140
4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The code is kind of long for a forum, where people expect the user to present a short, clear example of a question, and difficult to read because of the lack of indentions. It's no wonder you haven't gotten any help yet.

Do you know how to read the error messages? Your first says that on line 106, the method gui.setVisible() could not be found.

Since gui is a "TrepForm" we have to look there to see if the method has been created with this name and "signature"(refers to the arguments or lack thereof). Indeed, there are no such methods, but JPanel (the Object that is extended by TrepForm) does have setVisible(boolean), albeit by itself extending JComponent. So, I'm guessing probably you need to add a boolean as an argument. Java considers setVisible() and setVisible(boolean) to be two distinct methods.

If you continue to have trouble figuring out the other error messages, you will have a better chance of getting help if you try to isolate a smaller example that illustrates the question, and present that.
 
You can thank my dental hygienist for my untimely aliveness. So tiny:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic