March 19, 20169 yr Dear Scripters, So i ran into a problem while making my first script, so basically the problem is :When the item is in my inventory, it has to run to the next case. But the problem is, even when the item is achieved, the bot still spam clicks the Cupboard. Instead if running to the second case. case GetPicture2:walking.webWalk(new Position(2984, 3335, 2));objects.closest("Cupboard").interact("Open");objects.closest("Cupboard").interact("Search");if(getInventory().contains("Portrait"));break;case GotPicture:talkNpcInArea("David", David_HOUSE, "Something else."); break; Any advice would be highly appreciated ! Edited March 19, 20169 yr by Takes A Nap
March 19, 20169 yr //in the getState method if(inventory.contains("Picture")) { return State.GotPicture; } These breadcrumbs should be enough, you need to try to research and learn on your own, it's different to school and being spoonfed. In the State scripts there are 2 parts: 1) setting the State 2) reacting to the State 1) Setting state: if you have the picture in your inventory, then the state is NOT State.GetPicture is it. Because you already have it! So since you have the picture, set the state as State.GotPicture 2) Reacting to the state: now the state is State.GotPicture you can do the next part of the quest. Check your OSBot private messages, I might just teamviewer connect to your PC and help you get this done and explain things to you step by step. Edited March 19, 20169 yr by MegaManAlpha
Create an account or sign in to comment