LordOfWar1275 0 Share Posted May 10, 2020 I’m trying to code a f2p rune essence mining script one of the problems I’m running into is the damn portal. It goes from being a gameObject to a NPC, I’ve tried using getNames and getID’. I’ve tried looking all over for prior forums, there’s a few here and there but nothing really specific. Also, I’m unable to interact with the GameObject “Rune Essence” another pain in the ass. I’ve Also tried using the objects Tile #, ID#, RealD#, Flag# even Index#. I am fairly new but I do a lot of research before am reaching out to the community I’m at a standstill here lmfao. Thanks for the help in advance Link to comment Share on other sites More sharing options...
Nuclear Nezz 2028 Share Posted May 10, 2020 What happens when you look at the rune essence block through the game debugger? It's possible there's a different game object that you're supposed to be interacting with. For the portal, when I made one (a really, really long time ago) I just checked for the game object, if it was null or not visible, I checked for the npc. Just make sure you're checking within a small distance, so you're not grabbing one in a different section. I believe tiles change in rune essence mine (not positive on that) Link to comment Share on other sites More sharing options...
LordOfWar1275 0 Author Share Posted May 10, 2020 1 hour ago, Nuclear Nezz said: What happens when you look at the rune essence block through the game debugger? It's possible there's a different game object that you're supposed to be interacting with. For the portal, when I made one (a really, really long time ago) I just checked for the game object, if it was null or not visible, I checked for the npc. Just make sure you're checking within a small distance, so you're not grabbing one in a different section. I believe tiles change in rune essence mine (not positive on that) I ended up using the GameObject runeEsscence getID==#, strange I did that before asking for help. Lol. The script is working but it acts up on the Portal again tho, I checked if npc!=null and isOnScreen(); it just right clicks the portal and rotates the camera very violently. I even tried checking — if(npc!=null){ getWorldHopper.hopWorlds(worlds[random]); /*^^^(worlds[random]) is a array stored with all f2p non requirements worlds, chosen randomly.*/ } —even with that code, the cursor will right click the portal but move just slightly down and misclick. It repeats that a few times swings the camera again and loops. Link to comment Share on other sites More sharing options...
LordOfWar1275 0 Author Share Posted May 10, 2020 I did see someone post this but idk how to use that getWalking().getAStarPathFinder().addObstacle(new PassableObstacle("Obstacle name", "Action", null, null, null)); Link to comment Share on other sites More sharing options...
Nex 2541 Share Posted May 10, 2020 7 hours ago, LordOfWar1275 said: I did see someone post this but idk how to use that getWalking().getAStarPathFinder().addObstacle(new PassableObstacle("Obstacle name", "Action", null, null, null)); That doesnt work anymore. Link to comment Share on other sites More sharing options...
LordOfWar1275 0 Author Share Posted May 10, 2020 39 minutes ago, Nex said: That doesnt work anymore. NPC portalNPC1 = getNpcs().closest(portal -> portal.getName().contains("<col=00efef>Portal</col>")); NPC portalNPC2 = getNpcs().closest(portal -> portal.getName().contains("<col=00ffff>Portal</col>")); if (portalNPC1 != null) { portalNPC1.isOnScreen(); if (portalNPC1.distance()<1){ getWalking().walk(portalNPC1); if (portalNPC1.hasAction("Use")){ portalNPC1.interact("use"); } else if (portalNPC1.hasAction("Exit")){ portalNPC1.interact("Exit"); } } }else if((portalNPC2!=null)){ portalNPC2.isOnScreen(); if(portalNPC2.distance()<1){ getWalking().walk(portalNPC2); if(portalNPC2.hasAction("use")){ portalNPC2.interact("use"); }else if(portalNPC2.hasAction("Exit")){ portalNPC2.interact("Exit"); } } } This is my code, I have tried using a NPC filter as well but does the same thing. The "<col=00efef>Portal</col>" is what the GameDebugging menu gave me, although there are two different names when i jump servers hence the portalNPC2. The GameObject portals work fine(they also have different #id)one portal is white the other is yellowish. I hate to be a burden, but if its possible someone can check this out and see if its just me or if its a bug in general? Link to comment Share on other sites More sharing options...
Nex 2541 Share Posted May 10, 2020 1 hour ago, LordOfWar1275 said: NPC portalNPC1 = getNpcs().closest(portal -> portal.getName().contains("<col=00efef>Portal</col>")); NPC portalNPC2 = getNpcs().closest(portal -> portal.getName().contains("<col=00ffff>Portal</col>")); if (portalNPC1 != null) { portalNPC1.isOnScreen(); if (portalNPC1.distance()<1){ getWalking().walk(portalNPC1); if (portalNPC1.hasAction("Use")){ portalNPC1.interact("use"); } else if (portalNPC1.hasAction("Exit")){ portalNPC1.interact("Exit"); } } }else if((portalNPC2!=null)){ portalNPC2.isOnScreen(); if(portalNPC2.distance()<1){ getWalking().walk(portalNPC2); if(portalNPC2.hasAction("use")){ portalNPC2.interact("use"); }else if(portalNPC2.hasAction("Exit")){ portalNPC2.interact("Exit"); } } } This is my code, I have tried using a NPC filter as well but does the same thing. The "<col=00efef>Portal</col>" is what the GameDebugging menu gave me, although there are two different names when i jump servers hence the portalNPC2. The GameObject portals work fine(they also have different #id)one portal is white the other is yellowish. I hate to be a burden, but if its possible someone can check this out and see if its just me or if its a bug in general? GameObject portal = getGameObjects().closest(p -> p != null && p.getName().contains("Portal")); if (portal != null && portal.isOnScreen()) { if (portal.distance(getlocalplayer()) < 5) { if (portal.hasAction("Use") && portal.interact("use")) { //sleep... } else { if (portal.interact("Exit")) { // sleep.. } } } else { if (m.getwalking().shouldWalk() { m.getwalking().walk(portal); } } } ^Didnt have IDE near so make sure to test it xD but u gonna want something like that Link to comment Share on other sites More sharing options...
LordOfWar1275 0 Author Share Posted May 10, 2020 48 minutes ago, Nex said: GameObject portal = getGameObjects().closest(p -> p != null && p.getName().contains("Portal")); if (portal != null && portal.isOnScreen()) { if (portal.distance(getlocalplayer()) < 5) { if (portal.hasAction("Use") && portal.interact("use")) { //sleep... } else { if (portal.interact("Exit")) { // sleep.. } } } else { if (m.getwalking().shouldWalk() { m.getwalking().walk(portal); } } } ^Didnt have IDE near so make sure to test it xD but u gonna want something like that Still it’ll right click the portalNPC and slightly misclick underneath the widget header a few times Link to comment Share on other sites More sharing options...
Nuclear Nezz 2028 Share Posted May 12, 2020 On 5/10/2020 at 7:28 AM, Nex said: That doesnt work anymore. What do you mean that doesn't work anymore On 5/10/2020 at 11:06 AM, LordOfWar1275 said: Still it’ll right click the portalNPC and slightly misclick underneath the widget header a few times Could you post a gif of what you're talking about? Link to comment Share on other sites More sharing options...
Nex 2541 Share Posted May 12, 2020 1 hour ago, Nuclear Nezz said: What do you mean that doesn't work anymore Could you post a gif of what you're talking about? We spoke about that awhile ago about adding obstacles to walker n it was bork :^) Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.