Jump to content

Help with First Script


Recommended Posts

Posted

Hi guys. Trying to make my first script by using explv 101 tutorial layout but making a chaos druid script instead.

however i was making my methods but for some reason i cant understand red lines are coming up. I even copied and pasted one of explv to see if it would work and i still got red lines.

any help would be appreciated :)

T7QASkR.png

 

 

  • Like 1
Posted (edited)
5 minutes ago, Luke Reading said:

Hi guys. Trying to make my first script by using explv 101 tutorial layout but making a chaos druid script instead.

however i was making my methods but for some reason i cant understand red lines are coming up. I even copied and pasted one of explv to see if it would work and i still got red lines.

any help would be appreciated :)

T7QASkR.png

 

 

Line 1: missing semicolon. Whenever you have a statement, it needs a semicolon. If placing a set of curly brackets after the statement doesn't work, you know it needs a semicolon.

the other ones between '(){' is because you're missing spaces between the '()' and '{'. That's just styling "errors" to make your code look pretty.

The long one; missing a bracket on the left side, right after the return.

Last two lines, they are erroring because you have return true, else, return true. This always returns true, make the second one return false.

Edited by apa
Posted
6 minutes ago, Chris said:

learn java first before using a osbot script tutorial

This.

Getting a basic understanding of Java before diving into the OSBot API is a really good idea. I reccommend getting a book on Java as these often come with some kind of exercises to get you comfortable with programming.

Posted (edited)
20 minutes ago, apa said:

Line 1: missing semicolon. Whenever you have a statement, it needs a semicolon. If placing a set of curly brackets after the statement doesn't work, you know it needs a semicolon.

the other ones between '(){' is because you're missing spaces between the '()' and '{'. That's just styling "errors" to make your code look pretty.

The long one; missing a bracket on the left side, right after the return.

Last two lines, they are erroring because you have return true, else, return true. This always returns true, make the second one return false.

EDIT: Found a solution :)

Edited by Luke Reading

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

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