bencebence Posted July 6, 2011 Author Share Posted July 6, 2011 It still throws up: "Invalid If/Endif block structure on line 113."and"Mismatched if/else/endif block starting one line 19."and"Mismatched if/then/else block on line 19." Link to comment Share on other sites More sharing options...
MarkInMKUK Posted July 6, 2011 Share Posted July 6, 2011 (edited) Shouldn't "player.playgroup Idle 1" come AFTER the else statement? (Darn - it's hard editing this on a smartphone screen) Also, do you have to use elseif instead of else if ? Edited July 6, 2011 by MarkInMKUK Link to comment Share on other sites More sharing options...
bencebence Posted July 6, 2011 Author Share Posted July 6, 2011 Scriptname RaivenMineScript short bluntskill short chance short chanceIron short chanceSilver short chanceGold short chanceGlass short chanceEbony Begin OnActivate set bluntskill to player.getactorvalue blunt set chance to getrandompercent set chanceIron to 2 set chanceSilver to 3 set chanceGold to 4 set chanceGlass to 5 set chanceEbony to 6 if (player.getequipped MiningPick == 1 && IsKeyPressed 44 == 1) ;Z key player.playgroup AttackPower 1 if (bluntskill > chance*chanceIron) playsound wpnblockblunt player.additem IroneOre 1 else if (bluntskill > chance*chanceSilver) playsound wpnblockblunt player.additem Gem0SilverNugget 1 else if (bluntskill > chance*chanceGold) playsound wpnblockblunt player.additem Gem0GoldNugget 1 else if (bluntskill > chance*chanceGlass) playsound wpnblockblunt player.additem glassore 1 else if (bluntskill > chance*chanceEbony) playsound wpnblockblunt player.additem EbonOre 1 else playsound wpnhitblunt message "You found nothing." endif if (chance == 10) playsound wpnblockblunt player.additem Coal 1 message "You found some coal." elseif (chance == 84) playsound wpnblockblunt player.additem gem2topazflawed 1 message "You found a flawed topaz." elseif (chance == 85) playsound wpnblockblunt player.additem gem2topaz 1 message "You found a topaz." elseif (chance == 86) playsound wpnblockblunt player.additem gem2topazflawless 1 message "You found a flawless topaz." elseif (chance == 87) playsound wpnblockblunt player.additem gem3rubyflawed 1 message "You found a flawed ruby." elseif (chance == 88) playsound wpnblockblunt player.additem gem3ruby 1 message "You found a ruby." elseif (chance == 89) playsound wpnblockblunt player.additem gem3rubyflawless 1 message "You found a flawless ruby." elseif (chance == 90) playsound wpnblockblunt player.additem gem4sapphireflawed 1 message "You found a flawed sapphire." elseif (chance == 91) playsound wpnblockblunt player.additem gem4sapphire 1 message "You found a sapphire." elseif (chance == 92) playsound wpnblockblunt player.additem gem4sapphireflawless 1 message "You found a flawless sapphire." elseif (chance == 93) playsound wpnblockblunt player.additem gem5emeraldflawed 1 message "You found a flawed emerald." elseif (chance == 94) playsound wpnblockblunt player.additem gem5emerald 1 message "You found am emerald." elseif (chance == 95) playsound wpnblockblunt player.additem gem5emeraldflawless 1 message "You found a flawless emerald." elseif (chance == 96) playsound wpnblockblunt player.additem gem6diamondflawed 1 message "You found a flawed diamond." elseif (chance == 97) playsound wpnblockblunt player.additem gem6diamond 1 message "You found a diamond." elseif (chance == 98) playsound wpnblockblunt player.additem gem6diamondflawless 1 message "You found a flawless diamond." endif else player.playgroup Idle 1 message "You must equip a Mining Pick to mine the rock." endif endIt's still the same errors. Link to comment Share on other sites More sharing options...
MarkInMKUK Posted July 6, 2011 Share Posted July 6, 2011 Cross-check your ifs and endifs - check you are not missing an endif Link to comment Share on other sites More sharing options...
fg109 Posted July 6, 2011 Share Posted July 6, 2011 (edited) if (bluntskill > chance*chanceIron) playsound wpnblockblunt player.additem IroneOre 1 elseif (bluntskill > chance*chanceSilver) playsound wpnblockblunt player.additem Gem0SilverNugget 1 elseif (bluntskill > chance*chanceGold) playsound wpnblockblunt player.additem Gem0GoldNugget 1 elseif (bluntskill > chance*chanceGlass) playsound wpnblockblunt player.additem glassore 1 elseif (bluntskill > chance*chanceEbony) playsound wpnblockblunt player.additem EbonOre 1 else playsound wpnhitblunt message "You found nothing." endif I don't know which Begin block you should use until you tell me exactly how you're going to mine stuff. Also, MarkInMKUK is right about how you want to put the lowest possibility stuff first. For your second set of if/elseif statements, I think you wanted to use "elseif (chance > **)", in which case you should reverse the order of your if/elseif statements. Edited July 6, 2011 by fg109 Link to comment Share on other sites More sharing options...
bencebence Posted July 6, 2011 Author Share Posted July 6, 2011 @fg109 This solved two of the problems, but the:"Invalid Begin/End block structure on line 109" still shows up. Link to comment Share on other sites More sharing options...
bencebence Posted July 6, 2011 Author Share Posted July 6, 2011 (edited) Scriptname RaivenMineScript short bluntskill short chance short chanceIron short chanceSilver short chanceGold short chanceGlass short chanceEbony Begin OnActivate set bluntskill to player.getactorvalue blunt set chance to getrandompercent set chanceIron to 2 set chanceSilver to 3 set chanceGold to 4 set chanceGlass to 5 set chanceEbony to 6 if (player.getequipped MiningPick == 1 && IsKeyPressed 44 == 1) ;Z key player.playgroup AttackPower 1 if (bluntskill > chance*chanceIron) playsound wpnblockblunt player.additem IroneOre 1 elseif (bluntskill > chance*chanceSilver) playsound wpnblockblunt player.additem Gem0SilverNugget 1 elseif (bluntskill > chance*chanceGold) playsound wpnblockblunt player.additem Gem0GoldNugget 1 elseif (bluntskill > chance*chanceGlass) playsound wpnblockblunt player.additem glassore 1 elseif (bluntskill > chance*chanceEbony) playsound wpnblockblunt player.additem EbonOre 1 else playsound wpnhitblunt message "You found nothing." endif endif if (chance == 10) playsound wpnblockblunt player.additem Coal 1 message "You found some coal." elseif (chance == 84) playsound wpnblockblunt player.additem gem2topazflawed 1 message "You found a flawed topaz." elseif (chance == 85) playsound wpnblockblunt player.additem gem2topaz 1 message "You found a topaz." elseif (chance == 86) playsound wpnblockblunt player.additem gem2topazflawless 1 message "You found a flawless topaz." elseif (chance == 87) playsound wpnblockblunt player.additem gem3rubyflawed 1 message "You found a flawed ruby." elseif (chance == 88) playsound wpnblockblunt player.additem gem3ruby 1 message "You found a ruby." elseif (chance == 89) playsound wpnblockblunt player.additem gem3rubyflawless 1 message "You found a flawless ruby." elseif (chance == 90) playsound wpnblockblunt player.additem gem4sapphireflawed 1 message "You found a flawed sapphire." elseif (chance == 91) playsound wpnblockblunt player.additem gem4sapphire 1 message "You found a sapphire." elseif (chance == 92) playsound wpnblockblunt player.additem gem4sapphireflawless 1 message "You found a flawless sapphire." elseif (chance == 93) playsound wpnblockblunt player.additem gem5emeraldflawed 1 message "You found a flawed emerald." elseif (chance == 94) playsound wpnblockblunt player.additem gem5emerald 1 message "You found am emerald." elseif (chance == 95) playsound wpnblockblunt player.additem gem5emeraldflawless 1 message "You found a flawless emerald." elseif (chance == 96) playsound wpnblockblunt player.additem gem6diamondflawed 1 message "You found a flawed diamond." elseif (chance == 97) playsound wpnblockblunt player.additem gem6diamond 1 message "You found a diamond." elseif (chance == 98) playsound wpnblockblunt player.additem gem6diamondflawless 1 message "You found a flawless diamond." endif else player.playgroup Idle 1 message "You must equip a Mining Pick to mine the rock." endif endI know that something is not good with the Begin line, but what should I do with it? Edited July 6, 2011 by bencebence Link to comment Share on other sites More sharing options...
fg109 Posted July 6, 2011 Share Posted July 6, 2011 (edited) else player.playgroup Idle 1 message "You must equip a Mining Pick to mine the rock." endif There's no if statement for this block. Like I said, I don't know which Begin block you should use until you tell me how you want to mine stuff. Do you want to just activate the iron/silver vein? Or grab it with the z key? Or maybe you want to swing your pickaxe at it? Edited July 6, 2011 by fg109 Link to comment Share on other sites More sharing options...
MarkInMKUK Posted July 6, 2011 Share Posted July 6, 2011 (edited) Try if (player.getequipped MiningPick == 1) if (IsKeyPressed 44 == 1) ;Z key to give you the missing "if" if (got pick)if (pressing the z key) Do everything elseendifelse Do the no pick stuffEndif Oh, and can you go back up and stuff the code into spoiler tags? My poor mouse wheel is nearly worn out scrolling :) Edited July 6, 2011 by MarkInMKUK Link to comment Share on other sites More sharing options...
bencebence Posted July 6, 2011 Author Share Posted July 6, 2011 @fg109I want to swing the pick to mine, but I don't really know how to do it. Link to comment Share on other sites More sharing options...
Recommended Posts