shelledroot
Members-
Posts
18 -
Joined
-
Last visited
-
Feedback
0%
Profile Information
-
Gender
Male
Recent Profile Visitors
The recent visitors block is disabled and is not being shown to other users.
shelledroot's Achievements
Newbie (1/10)
1
Reputation
-
Notation of K and M like RS in PHP
shelledroot replied to shelledroot's topic in Software Development
Yeah I guess so. Never mind about this. :\ I'm reading an int from a DB table and want to save space on the table row I'm displaying. But I want it to correctly show. if I just round it at 2 decimals the 3rd decimal flows over still and so on and so forth. Basically I wanted the RS notation in my table, that code gives me that although it isn't nice looking. :\ I was thinking since there is an pattern there should be a recursive solution to this problem but my mind is in need of sleep. -
Notation of K and M like RS in PHP
shelledroot replied to shelledroot's topic in Software Development
$holdingAmount = $Mulesrow['holdingamount']; if($holdingAmount >= 1000){ $holdingLength = strlen($holdingAmount); switch ($holdingLength) { case 4: $dotPlacementHolding = 1; break; case 5: $dotPlacementHolding = 2; break; case 6: $dotPlacementHolding = 3; break; case 7: $dotPlacementHolding = 1; break; case 8: $dotPlacementHolding = 2; break; case 9: $dotPlacementHolding = 3; break; case 10: $dotPlacementHolding = 4; break; default: break; } if ($holdingAmount >= 1000000) { $holdingAmount = substr_replace($holdingAmount, ".", $dotPlacementHolding, 0); $holdingAmount = substr($holdingAmount, 0, -4) . "M"; } else if ($holdingAmount >= 1000) { $holdingAmount = substr_replace($holdingAmount, ".", $dotPlacementHolding, 0); $holdingAmount = substr($holdingAmount, 0, -1) . "K"; } } I sloppy fixed something together. My initial question was wrong, though you answered that question correctly. Blame that on not enough sleep. I shall sleep and fix it properly in the morning. What I meant to ask is I want to do proper RS notation How would I do that without rounding the number up or down at a certain N decimal. This fix works for now until i revisit it but I thought there would be a nicer way to do it. -
Notation of K and M like RS in PHP
shelledroot replied to shelledroot's topic in Software Development
Sorry I formed my answer poorly. I'll update it and also rephrase it here: I want the number notation like RS so 21.11m but no fallover which will be generated due to 21.11999999999. I need the notation to stay true at all times. Not just depending on the N decimal place but a variable N length. -
For the project I'm working on I am trying to display the GP on page of a mule but I can't get it to correctly show the notation. :x $holdingAmount = $Mulesrow['holdingamount']; if($holdingAmount >= 1000){ $holdingLength = strlen($holdingAmount); $strArg = 1; for($i = 0; $i < $holdingLength; $i++){ $strArg = $strArg * 10; } if ($holdingAmount >= 1000000) { $holdingAmount = floor(($holdingAmount / 1000000) * $strArg ) / $strArg . "M"; } else if ($holdingAmount >= 1000) { $holdingAmount = floor(($holdingAmount / 1000) * 100) / 100 . "K"; } } I need it to show the correct amount depending on the annotation. So if I for example have 21119999 it should show 21.11M instead of 21.12M. This should be done so depending on the length.
-
Thanks that works. New at using an API (other then REST API's), and being off java for a few years. This should probably get me a long way. You have my thanks and a like.
-
sooo: if(getWidgets().getWidgetContainingText("Accept") != null && getWidgets().isVisible(widgetRoot#, widgetChild#) == true) ?
-
I'm just starting to learn to work with the API and I'm at a roadblock. I'm trying to create a script for tut island but it's throwing me an error: package rootTutorial; import java.awt.*; import org.osbot.rs07.api.ui.RS2Widget; import org.osbot.rs07.script.Script; import org.osbot.rs07.script.ScriptManifest; @ScriptManifest(author = "shelledroot", info = "Tutorial Runner", name = "rootTutorial", version = 0.1, logo = "") public class main extends Script { @Override public void onStart() { log("Tutorial Island script!"); } @Override public int onLoop() throws InterruptedException { // TODO Auto-generated method stub if(getWidgets().getWidgetContainingText("Accept") != null) { getWidgets().getWidgetContainingText("Accept").interact("Accept"); } return 0; } @Override public void onExit(){ log("Script has finished! Go get those 7 QP you need!"); } @Override public void onPaint(Graphics2D g) { // Drawing a simple message to the screen canvas g.drawString("Hello World", 400, 250); } } It completes clicking the Accept button in the widget but somehow: if(getWidgets().getWidgetContainingText("Accept") != null) Still returns true afterwards.. Is this some Jagex trickery or am I just plain dumb (both could be very possible). After clicking it the loop should restart from the top and the test should be false right?
-
Guess more custom scripts to write. Oh well, lower ban rate anyway. But still wish there was support for chainloading in either the API or client.
-
This: I guess I'll have to do it the hard way and write a script && file to keep track of which process is doing what script with which account etc... Or write a script which does all tasks instead of having segmented scripts, but that would be a clusterfudge of a script. :\
-
I intend to deploy SDN scripts as well as write my own scripts. But I have yet to look at the API fully as well as my java being rusty.. :\ This more of a question so I can scope out what I need for my automated farm. See, the problem is that I am working on my own botfarm(multiple servers, webserver & DB for tracking and deploying tasks to servers etc. as C&C of sorts). I was hoping there was a feature for this but guess I'll have to make something myself then.
-
Is there any way to chainload scripts? Say for example It'd want to make a suicide woodcutting bot then it'd want to do this: Load and complete Tutorial Island script -> Load and complete leveling script -> Load and run suicide woodcutting script Is there anything capable of this either via CLI (preffered) or API? I know I can for example do this: Run bot: onExit() calls System.exit(0); <-- This is so that the Bot itself quits as it will need to respawn #!/bin/sh java -jar OSBot.jar -login shelledroot:OMGIHAZPASS -bot suicideme@fake.faker:iam1337:0000 -script tutorialIsland:param1 -world 394 sleep 10m java -jar OSBot.jar -login shelledroot:OMGIHAZPASS -bot suicideme@fake.faker:iam1337:0000 -script levelMeUpBra:param1 -world 394 sleep 2h java -jar OSBot.jar -login shelledroot:OMGIHAZPASS -bot suicideme@fake.faker:iam1337:0000 -script BruvYouGetDatGP:param1 -world 394 But then I have to reload the bot every time which just seems like a waste as well as I have to guess a sleep amount. I could look up their PID after starting, but this will become a bothersome task with lots of bots open even when automated.
-
Has this been solved yet?
-
I haven't looked much at the OSBot API itself but is there a way to pull all SDN script names and sdnid's? I'm creating an automated bot farm and I think it'll be usefull for to have those names and ID's in a table in my DB. Is this possible? If so where should I look? Also wasn't sure if I should post this in script development section or software development since my aims overlap.
-
Guess I'm making one of those botfarm thingies..
shelledroot replied to shelledroot's topic in Projects
Posted some more progress. Amazing what you can get done with no life for less then 24 hours and skipping a night. public class Programmer extends Bot(){ while(!sleeping){ eat(); code(); } while(sleeping){ farm.bots(); } } public int onLoop(){ Programmer(); } -
OSBot CLI Script Creator - Manage your bots easily
shelledroot replied to The Hero of Time's topic in Projects
#OSBotCLIScriptCreatorForLinuxPlz Kidding aside it's a nice thing can it chain scripts too and by chaining I mean multiple scripts after another on one bot with rebooting it? If so I might have to leech a bit of code. ? I wonder why you choose to write it in C# though? Is it because you are most proficient in that language or some other reason? I would've chosen for java or c/c++ application, heck even python or something. Seeing as those who run multiple accounts try to cram as much out of their box as possible and linux (the os itself) takes less ram by default. I ain't bashing though. You've made something that put a smile on my face. ? I'm trying to achieve something similair only then with PHP/web front + cron + java and probably BASH though most likely BASH will be some basic executer of tasks and semi automatcally generated.