ECH0 Posted June 8, 2019 Posted June 8, 2019 Hello, how would I preselect spell? I tried this, but it isn't working: if(getMagic().isSpellSelected() == false) { status = "Selecting spell"; log("Selecting spell"); getMagic().hoverSpell(Spells.NormalSpells.TELEKINETIC_GRAB); sleep(random(500, 5000)); } It just loops it, never selecting. Also, when using castSpellOnEntity(), a few times the bot selects the cast over and over again, and then it preselects it by himself. Is it supposed to be like that or it's accidental bug/feature?
FuryShark Posted June 8, 2019 Posted June 8, 2019 14 minutes ago, ECH0 said: Hello, how would I preselect spell? I tried this, but it isn't working: if(getMagic().isSpellSelected() == false) { status = "Selecting spell"; log("Selecting spell"); getMagic().hoverSpell(Spells.NormalSpells.TELEKINETIC_GRAB); sleep(random(500, 5000)); } It just loops it, never selecting. Also, when using castSpellOnEntity(), a few times the bot selects the cast over and over again, and then it preselects it by himself. Is it supposed to be like that or it's accidental bug/feature? if (!getMagic().isSpellSelected()) { if (getMagic().castSpell(Spells.NormalSpells.TELEKINETIC_GRAB)) { // sleep } } else { // interact with something }
ECH0 Posted June 8, 2019 Author Posted June 8, 2019 3 minutes ago, FuryShark said: if (!getMagic().isSpellSelected()) { if (getMagic().castSpell(Spells.NormalSpells.TELEKINETIC_GRAB)) { // sleep } } else { // interact with something } Wanted to ask: if (getMagic().castSpell(Spells.NormalSpells.TELEKINETIC_GRAB)) this executes that commands and returns true if it succeeds? Also, maybe you could explain your code a bit?
Chris Posted June 8, 2019 Posted June 8, 2019 1 minute ago, ECH0 said: Wanted to ask: if (getMagic().castSpell(Spells.NormalSpells.TELEKINETIC_GRAB)) this executes that commands and returns true if it succeeds? Also, maybe you could explain your code a bit? its in the API docs
ECH0 Posted June 8, 2019 Author Posted June 8, 2019 5 minutes ago, Chris said: its in the API docs But on whom it casts that spell?
Chris Posted June 8, 2019 Posted June 8, 2019 33 minutes ago, ECH0 said: But on whom it casts that spell? https://osbot.org/api/org/osbot/rs07/api/Magic.html