roguehippo Posted September 15, 2016 Share Posted September 15, 2016 hey guys, im having a bit of a problem when it comes to accessing the players information from inside of the gui class. currently it gives me a null pointer when i use something like myPlayer().getPosition even though i have called MethodProvider m; public Gui (MethodProvider m){ this.m = m; } the exact code causing a problem is here: FightArea = m.myPlayer().getArea(Integer.parseInt(TileRadius.getText())); its just making an area with a defined radius from a textfield. Quote Link to comment Share on other sites More sharing options...
Xylate Posted September 15, 2016 Share Posted September 15, 2016 Just a shot outta the dark... but are you initializing your GUI before the player is logged in? Quote Link to comment Share on other sites More sharing options...
Juggles Posted September 15, 2016 Share Posted September 15, 2016 I had the same issue when making my script.Read this threadhttp://osbot.org/forum/topic/104466-grabbing-myplayers-start-area-with-gui/ Quote Link to comment Share on other sites More sharing options...
roguehippo Posted September 15, 2016 Author Share Posted September 15, 2016 Just a shot outta the dark... but are you initializing your GUI before the player is logged in? umm i think the player is ussually logged in but this happens no matter what I had the same issue when making my script. Read this thread http://osbot.org/forum/topic/104466-grabbing-myplayers-start-area-with-gui/ ohh i think thats exactly what my problem is, i have to pass "script" in with the gui? is that as simple as just adding in the Gui(Script script) instead of gui(). How should i add the script into the gui when im calling it from onStart()? Quote Link to comment Share on other sites More sharing options...
Alek Posted September 16, 2016 Share Posted September 16, 2016 Why Script and not Bot? Bot getMethods() returns MethodProvider Quote Link to comment Share on other sites More sharing options...
roguehippo Posted September 16, 2016 Author Share Posted September 16, 2016 Why Script and not Bot? Bot getMethods() returns MethodProvider is Bot a type? how do i use it to get the method i need? sorry i havent used it before Quote Link to comment Share on other sites More sharing options...
LoudPacks Posted September 16, 2016 Share Posted September 16, 2016 What is the exception type and message? Quote Link to comment Share on other sites More sharing options...
Viston Posted February 4, 2018 Share Posted February 4, 2018 (edited) On 16/09/2016 at 12:00 AM, Juggles said: I had the same issue when making my script. Read this threadhttp://osbot.org/forum/topic/104466-grabbing-myplayers-start-area-with-gui/ Hai Edited February 4, 2018 by Viston Quote Link to comment Share on other sites More sharing options...
Juggles Posted February 4, 2018 Share Posted February 4, 2018 8 minutes ago, Viston said: Hai Hi pm Acerd for script related issues Quote Link to comment Share on other sites More sharing options...