FANDOM


Introduction

Well I'm trying out some of the coding I've done in C++, jscript is really easy compared to C, I'm just having a hard time getting rid of bugs... I have a fishing skill going currently though, It works exactly how it was envisioned on the forum, just only the first 5 levels are coded so far.

Code

//What to Do:
//Load Lib, Define Variables, Check Fishing Level,
//Fishing Chance, Give Player Item, Report To Player.
UseLib("def.js");
function OnExecute{
var fishing = Sender.SkillValue("Fishing");
//Found Fishing Level
var i = Rnd(1,5);
//Fishing Chance
if (fishing >= 0){
//Test if Player has a Fishing Level
if (i == 3){
if (fishing == 1){
//Checked Fishing Level
//Check for Rod
if (Sender.ItemExists(10001)){
Echo("You Caught a Hake!");
//Printed Info to Player
addItem(10005);
//Gave Player Hake
}
}
else if (fishing == 2){
//Fishing Level Checked
//Check for Net
if (Sender.ItemExists(10002)){
Echo("You Caught an Anchovie!");
//Report Success to Player
//Give Player Anchovie Item
addItem(10007);
}
}
else if (fishing == 4){
if (sender.ItemExists(10003){
Echo("You Caught a Crab!");
addItem(10006);
}
}
}
//Fail Message
else if (i != 3){
echo("You Failed to Catch Anything");

}
}
//Check for fishing level failed (<1)
//Report to Player How to Get a Level, and Items
else{
echo("You Have No Fishing Experience, Speak to the Guild Master");
}
return;
//Return None
}

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.