Jump to content
View in the app

A better way to browse. Learn more.

OSBot :: 2007 OSRS Botting

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

My first cow killer script help.

Featured Replies

Hey Guys,

I was following Swizzbeat's youtube video and the written guide for two example scripts and whenever I put them into the OSBot folder it will not play the script.  The mouse cursor will simply sit there and not interact with anything even though I followed his guide perfectly.  Can anyone help me?  I will post my code below for my cow killer script to see if anyone can help.

package CowKillerProject;

import org.osbot.script.Script;
import org.osbot.script.ScriptManifest;
import org.osbot.script.rs2.model.Entity;

@ScriptManifest(author = "Gengar", info = "Cow Killer", name = "CowKiller .1", version = 0.1)

public class cowkiller extends Script{
	final String Cow_Name = "cow";
	public void onStart(){
		log("Start at cows!");	
	}
	public int onLoop() throws InterruptedException {
		Entity cow = closestAttackableNPCForName("Cow_Name");
	
	if (cow !=null){
	if (!client.getMyPlayer().isUnderAttack())
		if (cow.isVisible()){
		cow.interact("Attack");
	}else{
		client.moveCameraToEntity(cow);
	}
		
	}
	return 50;
}
	public void onExit(){
		log("Thank you for using my script!");
	}
}

Why does everyone think that's my video? I explicitly state in the line before it that @H0ppy made it O_o

 

And no offence but I suggest learning Java before scripting. The error you made is extremely easy to spot (look at the argument your passing to the closest...NPC() method).

Edited by Swizzbeat

  • Author

Sorry lol, I had my headphones turned down at the very beginning, and I am currently in college for java programming so I figured that this would some good practice on the side.

Entity cow = closestAttackableNPCForName("Cow_Name");

 

should be:

 

Entity cow = closestAttackableNPCForName(Cow_Name);

(No quotation marks)

 

Quotation marks are for strings. If you want to use a variable you don't use quotation marks.

 

Also you should look up some Java Naming Conventions:

http://en.wikipedia.org/wiki/Naming_convention_(programming)#Java

 

Your class should be CowKiller. It's not something that affects your code but it is something that makes your code more readable.

Edited by Artemis

  • Author

Alright thanks! I am currently studying more and I sometimes mix things up between java and C++ :P

Guest
This topic is now closed to further replies.

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.