Questions...

Stinkweed

New member
Well, I am new to scripting and I feel as if I should crawl back to Noob Cave. Anyway, I have some questions that perhaps you guys can help clarify. After hours of reading the manual on this topic, I still can't find out:

1. What is the exact line is to make the player cast spells, targeting another player (or even themselves :S)
2. How to make a script repeat itself.:confused:

I would really appreciate if you were able to give me the lines and an example with all the signs and bracket. Thanks in advance :)
 
Last edited:

Bale

Minion
Here's an example that should illustrate the problems you face. Note that all whitespace characters (tabs, spaces, carriage returns) are irrelevant and only exist to make the script easier to read. Those are a matter of style so you can format it differently without fear that it won't work.
Code:
while(my_hp() < my_maxhp() ) {
	use_skill(1, $skill[tongue of the walrus]);
}

The most common way of "making a script repeat itself" is to use the while command. While the expression inside of parenthesis is true, it will repeatedly execute the lines of code inside the curly brackets.

First, if my_hp() is less than my_maxhp() it will use tongue of the walrus 1 time. Then it will test to see if it is still true and if so it will use tongue of the walrus once more, then again until my_hp() is equal to my_maxhp().

Remember to put a semi-colon after every command that is to be executed.

Does that answer the problem you're having?
 

Stinkweed

New member
Thanks a lot:) Clarified a few things :), but say I wanted to cast on another person, what do I add to the line?

use_skill(1, $skill[The Polka of Plenty], ??? );
 

Stinkweed

New member
Yeah, I read that too. Unfortunately, I have no idea what exactly "string your_target" is. I have tried putting string your_target[playername] and other combinations, but to no avail :S I would greatly appreciate if you gave me an example of what it looked like. Thanks again :)
 

Bale

Minion
string is the data type. A string is a collection of alphanumberic characters bounded by quotes.

use_skill(1, $skill[The Polka of Plenty], "bale");

lostcalpolydude was trying to be helpful. You should have explained that you were new to programming, not just ash scripting so he could know to explain more. In the lists of available functions the parameter lists are composed of paired words, the first part is the data type and the second is the name of the parameter. If other datatypes puzzle you, please ask about them
 
Last edited:

Stinkweed

New member
Woo, thanks :) Well, I seem to have another problem. I can't get the script to repeat itself (after it's been run once) even if the conditions are met. I have to load it again. Do you have to do something with the repeat command to do this? Thanks in advance again :)
 

Bale

Minion
I'm afraid that you'd need to tell me more in order to help you.

repeat until is similar to while except that it doesn't check conditions until after running the code once and it will stop if the condition is true, instead of false.

If that doesn't help, then please copy-paste the troublesome code here inside of [code][/code] tags.
 
Top