Adding a new method to Script.java to to work with BSH scripting


#1

Been having trouble figuring out what i would need to write to add a “repeat option” so that i can repeat PickOptions… I was thinking SendMenu1, SendMenu2, SendMenu3, SendMenu4 ect…

Each time I do a PickOption i have to remove 1 option out of the pick option SO:

option(“1”, “2”, “3”); it ends up if i choose option 1, i have to remove option 1 so its option(“2”, “3”); it ends up if i choose option 2, i have to remove option 2 so its option(“3”); it ends up if i choose option 3, i have to end it there… no more options…

example of What i want:

SendMenu(1);

SendMenu(2);

if(SendMenu = 1);
option = PickOption(“1”, “2”, “3”);

if(SendMenu = 2);
option = PickOption(“1”, “3”);

that way i dont need to remove pickoptions til its out of options…


#2

You could create a method that handles the response.

handleResponse(option) { // logic }

Alternatively, you could use MoparClassic’s system.


#3

im using easyrsc…

so would u write:

public int handleResponse(option) {

…and what else?


#4

[quote=“xrune, post:3, topic:507186”][quote author=CodeForFame link=topic=625416.msg4257129#msg4257129 date=1362956507]

Alternatively, you could use MoparClassic’s system.
[/quote]

im using easyrsc…

so would u write:

public int handleResponse(option) {

…and what else?[/quote]No, you can create methods in BSH… You don’t need to do it in Java.


#5

i want hit punch whoever decided to use beanshell, it sucks so much. Lua would be a better language to use, considering it has similar, simplistic syntax and more features.


#6

It was xent, and he knows a lot more above coding that you do.


#7

[quote=“Wife Beater, post:6, topic:507186”][quote author=imthenull link=topic=625416.msg4257499#msg4257499 date=1363023340]
i want hit punch whoever decided to use beanshell, it sucks so much. Lua would be a better language to use, considering it has similar, simplistic syntax and more features.
[/quote]

It was xent, and he knows a lot more above coding that you do.[/quote]BSH was a completely terrible choice… It’s hard to think of one that would be worse. TBH he would have been better off just sticking to Java, seeing BSH is the exact same as Java, minus some keywords/types, and much slower.


#8

[quote=“Wife Beater, post:6, topic:507186”]he knows a lot more above coding that you do.[/quote]lol’d anyone who calls programming “coding” is a retard, go back to the rs2 boards, nonetheless you have no idea what i know.

[quote=“CodeForFame, post:7, topic:507186”][quote author=Wife Beater link=topic=625416.msg4257516#msg4257516 date=1363025469]

It was xent, and he knows a lot more above coding that you do.
[/quote]BSH was a completely terrible choice… It’s hard to think of one that would be worse. TBH he would have been better off just sticking to Java, seeing BSH is the exact same as Java, minus some keywords/types, and much slower.[/quote]
Yeah, that’s why i suggested lua would be a better choice, it’s not bad on speed, it’s got some good features, and the syntax is great for people who don’t really know how to program


#9

You “lol” at a lot, don’t you, imthenull? Now it’s my turn. So, “lol” at you for giving a damn about the usage of the word “coding”. It’s not like it makes a difference. :slight_smile:


#10

Why yes, I do laugh at the users of Moparscape quite often, their stupidity never ceases to amaze me.

As for that second bit, there is a difference, and a large one at that. Programming is the development of computer software applications via a programming language of some sort, while of the other hand coding is what RS2 narbs (probably like yourself) say to make themselves look cool in front of friends irl.


#11

Yes, I have noticed this site is full of novice people. Most probably self-taught.

The word “coding” is sometimes used instead of the word “programming”, because it’s shorter. The meaning is the same. We use it occasionally at work. I don’t consider myself a retard. :wink:

I am not involved with any private server development, so no, I’m not a RuneScape (2) “narb”.


#12

Coding != Programming


#13

You know, most people would continue this conversation, but unlike them, I say what I have to in my first couple of posts, and I’m done. I usually don’t respond back, and I usually don’t change my thoughts/opinions.

Using the term coding in place of programming lets out an unprofessional vibe to me. I hate the word, and will never use it, outside conversations like this.


#14

i agree with this… just thought someone knew a little something to help me out… plus i cant get mopars source to work on my computer… dunno why…


#15

[quote=“xrune, post:14, topic:507186”][quote author=0xCAFEBABE link=topic=625416.msg4257607#msg4257607 date=1363033108]
Yes, I have noticed this site is full of novice people. Most probably self-taught.
[/quote]
i agree with this… just thought someone knew a little something to help me out… plus i cant get mopars source to work on my computer… dunno why…[/quote]What problems are you having?