Jump to content

[RQ]Updated video tutorial maybe?


Malii

Recommended Posts

Was curious if anyone could make an updated/better video tutorial with the basics of scripting?

 

I can read scripts most of the time, like I have a basic understanding of the language, but I'm a huge hands on need to see/follow learner.

 

I've spent the last four or five nights now just opening eclipse, opening the script skeleton and not knowing where to start or how to start.

 

I know what type of script I want to make, but I can't figure out how to turn what I want into code. Every tutorial I watch is a fucking woodcut script with like fifteen lines of code, everyone speaks so fast, and everyone uses different ways to write their script so it confuses me.

 

Maybe I'm asking to much, but figured I ask anyways.

 

I'd appreciate any help. Probably going to get flamed, but whatever.

 

 

  • Like 1
Link to comment
Share on other sites

I may make one if I get the time (or collab with someone to bring a tutorial to you). Been busy with finals coming up. but don't get discouraged my friend. Keep trying!

 

EDIT: If you could leave any information you would like covered that would make it easier on me.

Drop it through an Osbot PM or quote me.

 

Also if you haven't checked already, here is a few scripting snippets I have made. It shows how to use some of Osbot's API

 

http://osbot.org/forum/topic/96505-osbot-scripting-basics-and-snippets/

 

Edited by TFW
Link to comment
Share on other sites

I may make one if I get the time (or collab with someone to bring a tutorial to you). Been busy with finals coming up. but don't get discouraged my friend. Keep trying!

 

EDIT: If you could leave any information you would like covered that would make it easier on me.

Drop it through an Osbot PM or quote me.

 

Also if you haven't checked already, here is a few scripting snippets I have made. It shows how to use some of Osbot's API

 

http://osbot.org/forum/topic/96505-osbot-scripting-basics-and-snippets/

 

What I've noticed in a lot of video tutorials is people will just type out the script, say whatever they're doing and all of a sudden stuff just comes together. Uh how do I explain this better... Like they type out a word and it gets connected to the api some how. I don't know. Just confuses me.

 

Thanks for the reply by the way.

Edited by Malii
Link to comment
Share on other sites

What I've noticed in a lot of video tutorials is people will just type out the script, say whatever they're doing and all of a sudden stuff just comes together. Uh how do I explain this better... Like they type out a word and it gets connected to the api some how. I don't know. Just confuses me.

 

Thanks for the reply by the way.

Have you attempted making a script before? Or just been watching videos? I would try making one on your own and then get a good understanding of what you can't grasp, that will make it easier to ask questions and get help imo.

Link to comment
Share on other sites

Have you attempted making a script before? Or just been watching videos? I would try making one on your own and then get a good understanding of what you can't grasp, that will make it easier to ask questions and get help imo.

I said that in my first post man. I don't know how to begin. I have the skeleton script, but I don't know where to start. Like do I start at the place I want, or the bank, do I start the walkpath first or? And then I think well how do I add more into this how do I connect this line of code with this line.

Link to comment
Share on other sites

I said that in my first post man. I don't know how to begin. I have the skeleton script, but I don't know where to start. Like do I start at the place I want, or the bank, do I start the walkpath first or? And then I think well how do I add more into this how do I connect this line of code with this line.

Is what you are trying to make private? I just started yesterday myself so I can try to help you. It will be useful to me too.

Link to comment
Share on other sites

So I started my first script by following the tutorials on the osbot youtube channel, but using my own shit for what I want. lol

 

Though I'm confused as to why some of the code doesn't work. For example in the video he types out,

 

 

(this.client.getInventory().contains()

 Which doesn't register for some reason, so I changed it to,

 

 

(this.getInventory().contains()

instead. Will this work the same?

 

 

Link to comment
Share on other sites

You said you are trying to make a script and dont know where to start so why not write down what u are gonna do?

 

So a tanning script would probably need cowhides + coins. So why not start at the bank

 

1. Start script at bank check if inventory has hides + coins if not then withdraw them

2. If invent has hides + coins then walk to tanner and tan it

3. Now that the inventory has tanned hides go bank them

 

As for the methods i think they got updated? Im not too sure so the old ones might not work, but try and see if the line u suggested works.

  • Like 2
Link to comment
Share on other sites

You said you are trying to make a script and dont know where to start so why not write down what u are gonna do?

 

So a tanning script would probably need cowhides + coins. So why not start at the bank

 

1. Start script at bank check if inventory has hides + coins if not then withdraw them

2. If invent has hides + coins then walk to tanner and tan it

3. Now that the inventory has tanned hides go bank them

 

As for the methods i think they got updated? Im not too sure so the old ones might not work, but try and see if the line u suggested works.

Very good, I wanted to write something like this for him yesterday but unfortunately got busy. I will help you more op in a little bit.

  • Like 1
Link to comment
Share on other sites

So I started my first script by following the tutorials on the osbot youtube channel, but using my own shit for what I want. lol

 

Though I'm confused as to why some of the code doesn't work. For example in the video he types out,

 Which doesn't register for some reason, so I changed it to,

instead. Will this work the same?

 

See that was old OSBot's API now u can just use it without (this) if u want help add my skype : progamerz.rs and i will try my best to help u.

  • Like 1
Link to comment
Share on other sites

So I started my first script by following the tutorials on the osbot youtube channel, but using my own shit for what I want. lol

 

Though I'm confused as to why some of the code doesn't work. For example in the video he types out,

 Which doesn't register for some reason, so I changed it to,

instead. Will this work the same?

Please remember I am new I may be using bad habbits, or harder ways of getting the same outcome!

 

 

Woke up and wrote this before I have to go to work didn't have a lot of time so its missing a lot of checks that you will want to have when you make yours I.E (do you have coins, do you have enough hides, what to do if it runs into those issues etc..)  Somethings like navigating to Ellis I would change if I had more time. This has got me motivated to make a script that gathers an X amount of hide then tans it looping, might have that done when I get home from work.

 

 

The script works fine but there are definitely better ways of doing everything hopefully by looking at this you can see that you have to map out what the bot needs to do and write it in a way that exceeds this.

@ScriptManifest(name = "Tanner", author = "Bradf3rd", version = 1.0, info = "Tans Hide", logo = "") 
public class LaTanner extends Script {
 
 
private final Position store = new Position(3279,3191,0);
 
    @Override
    public void onStart() {
        //Put anything you want it to do on start like time etc..  
    }
    
    
    private enum State{
     BANK,WALK2ELLIS
    }
    
    private State getState(){
     if(!inventory.contains(1739)){//IF inventory doesn't contain hide
     return State.BANK; //Goes to bank
     } else {//Else it will
     return State.WALK2ELLIS;//Walk to ellis and tan the hides.
     }
         //Writing it like this basically means ONCE you tan the hides you won't have any remaining in yoru inventory to it switches back to the state BANK.
     }
    
    
    @Override
    public void onExit() {
        //Code here will execute after the script ends
 
 
    }
 
 
   
@Override
    public int onLoop() throws InterruptedException {
switch (getState()){

case WALK2ELLIS: 

RS2Widget leather = getWidgets().get(324, 148);//This is defining leather as the Soft Leather option in trade menu for Ellis see more from TFW's Tut http://osbot.org/forum/topic/96505-osbot-scripting-basics-and-snippets/
walking.webWalk(store); //Walks to the position store which is initiated above.
NPC ellis = getNpcs().closest("Ellis");//Initiates ellis as npc Ellis
walking.walk(ellis);  //If ellis is near we walk to her
sleep(random(300,600));//random sleep between 300 and 600 ms
ellis.interact("Trade");//Interacts with npc ellis selecting the option trade.
sleep(random(300,600));//random sleep between 300 and 600 ms
leather.interact("Tan All");//uses our widget we made above and interacts with it by selecting the option tan all
sleep(random(300,600));//random sleep between 300 and 600 ms
break; 

case BANK:

walking.webWalk(Banks.AL_KHARID.getRandomPosition()); //Walks to AL_KHARID bank
if(Banks.AL_KHARID.contains(myPlayer())){ //if Al kharid bank contains our player...
sleep(random(300,600));//random sleep between 300 and 600 ms
bank.open();//Opens bank
sleep(random(300,600));//random sleep between 300 and 600 ms
bank.withdraw(1739, 27);//Withdraws(int for our cowhides, number of cowhides)
}
break;
}
 
        return 600; //The amount of time in milliseconds before the loop starts over
    }
 
 
    @Override
    public void onPaint(Graphics2D g) {
        //This is where you will put your code for paint(s)
 
 
 
 
    }
 
 
}
Edited by Bradf3rd
  • Like 1
Link to comment
Share on other sites

Was curious if anyone could make an updated/better video tutorial with the basics of scripting?

 

I can read scripts most of the time, like I have a basic understanding of the language, but I'm a huge hands on need to see/follow learner.

 

I've spent the last four or five nights now just opening eclipse, opening the script skeleton and not knowing where to start or how to start.

 

I know what type of script I want to make, but I can't figure out how to turn what I want into code. Every tutorial I watch is a fucking woodcut script with like fifteen lines of code, everyone speaks so fast, and everyone uses different ways to write their script so it confuses me.

 

Maybe I'm asking to much, but figured I ask anyways.

 

I'd appreciate any help. Probably going to get flamed, but whatever.

 

I'll make you one boss

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...