Dab in a Lab Posted May 22, 2018 Share Posted May 22, 2018 Anyone know, or willing to provide a snippet for getting the current time and/or current region? I'm trying to learn this next to make a custom LoginHandler, and have no clue where to start. I see I need to use XClient, but I'm a bit lost with it. Any help would be greatly appreciated. Quote Link to comment Share on other sites More sharing options...
HeyImJamie Posted May 22, 2018 Share Posted May 22, 2018 You could've literally googled an answer and found the solution within the time it would've taken you to create this thread. For that reason, I don't see the need to spoon feed you the snippet. I will give you a hint though, Java has a Date class. 1 Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 22, 2018 Author Share Posted May 22, 2018 1 minute ago, HeyImJamie said: You could've literally googled an answer and found the solution within the time it would've taken you to create this thread. For that reason, I don't see the need to spoon feed you the snippet. I will give you a hint though, Java has a Date class. Oh Thought this used the OSBot API. Thanks Quote Link to comment Share on other sites More sharing options...
WhoKnew Posted May 23, 2018 Share Posted May 23, 2018 2 hours ago, Dab in a Lab said: Oh Thought this used the OSBot API. Thanks OSBot uses java API. Correct me if i'm wrong, but OSBot API is just a bunch of custom java methods ect . Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 23, 2018 Author Share Posted May 23, 2018 2 hours ago, WhoKnew said: OSBot uses java API. Correct me if i'm wrong, but OSBot API is just a bunch of custom java methods ect . Ya I believe so. I thought I had to use XClient though, so I went through quite a few threads related to XClient, getCurrentTime, and getCurrentRegion, but didn’t find anything too useful in my search. I didn’t think to look through Java’s API to setup a method with that though Quote Link to comment Share on other sites More sharing options...
Juggles Posted May 23, 2018 Share Posted May 23, 2018 Don't think osbot API has a method to get irl time. Java classes should tho Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 23, 2018 Author Share Posted May 23, 2018 43 minutes ago, Juggles said: Don't think osbot API has a method to get irl time. Java classes should tho Would this not work? https://gyazo.com/0565e590df2007c0a8d8823897291525 Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 23, 2018 Share Posted May 23, 2018 41 minutes ago, Dab in a Lab said: Would this not work? https://gyazo.com/0565e590df2007c0a8d8823897291525 Difficult question when we don't know what you want to do.. It would work if whatever you want to do can be done with the use of the currently loaded game tiles and client tick counter Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 23, 2018 Author Share Posted May 23, 2018 7 minutes ago, FrostBug said: Difficult question when we don't know what you want to do.. It would work if whatever you want to do can be done with the use of the currently loaded game tiles and client tick counter Lol oh... would that just be used for game tiles and tick counts? I was thinking it got the current time of a region (time zone)... I’ll look into the date class Jamie said. I was wanting the bot to log in at a specific time, and logout at one Quote Link to comment Share on other sites More sharing options...
Explv Posted May 23, 2018 Share Posted May 23, 2018 17 minutes ago, Dab in a Lab said: Lol oh... would that just be used for game tiles and tick counts? I was thinking it got the current time of a region (time zone)... I’ll look into the date class Jamie said. I was wanting the bot to log in at a specific time, and logout at one Just Google it !!!!!!!!!!!!!!!!!!! https://stackoverflow.com/questions/9156156/how-to-get-local-time-of-different-time-zones 1 1 Quote Link to comment Share on other sites More sharing options...
Dab in a Lab Posted May 23, 2018 Author Share Posted May 23, 2018 5 minutes ago, Explv said: Just Google it !!!!!!!!!!!!!!!!!!! https://stackoverflow.com/questions/9156156/how-to-get-local-time-of-different-time-zones Thanks. I was gonna google is when I sat down to work on my script again, and I haven’t worked on it today. I was just making sure I understood what getCurrentTime and getCurrentRegion actually got for future reference Quote Link to comment Share on other sites More sharing options...