xienne15 Posted August 6, 2013 Group: Members Topic Count: 44 Topics Per Day: 0.01 Content Count: 226 Reputation: 11 Joined: 01/09/12 Last Seen: March 15, 2018 Share Posted August 6, 2013 bif_fild01,163,61,4 script MINING SPOT 66,{ if (countitem(558) > 1) goto OnMine; mes "A big rock."; close; OnMine: setarray .@array, 26106, 10, 26107, 10, 640, 15, 714, 15, 715, 60, 716, 60, 717, 60, 718, 20, 719, 20, 720, 20, 721, 20, 722, 20, 723, 20, 724, 20, 725, 20, 726, 20, 727, 20, 728, 20, 729, 20, 730, 16, 731, 14, 732, 12, 733, 50, 6077, 20, 7300, 20, 756, 20, 757, 20, 2794, 5, 7049, 70, 6078, 70, 7067, 70 ; set .@len, getarraysize(.@array); delitem 26105,1; if(rand(2)-1) while(set(.@i,.@i+2)-2<=.@len) if(rand(100)<=.@array[.@i]) { set .@item, .@array[.@i]-1; misceffect 795; soundeffect "mining.wav",0; progressbar "brown",2; misceffect 795; specialeffect2 610; getitem(.@item,1); mes "You successfully mined a "+getitemname(.@item)+"."; close; } misceffect 795; soundeffect "mining.wav",0; progressbar "brown",2; misceffect 795; mes "You failed to mine."; specialeffect2 611; close; } i am only getting the 26106 in the arrray. How to fix this? Quote Link to comment Share on other sites More sharing options...
Skorm Posted August 6, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted August 6, 2013 (edited) i am only getting the 26106 in the arrray. How to fix this? If you're getting help on a topic don't make another topic about the same thing... This forums has enough post. bif_fild01,163,61,4 script MINING SPOT 66,{ if (countitem(558) > 1) goto OnMine; mes "A big rock."; close; OnMine: setarray .@array, 26106, 10, 26107,10, 640,15, 714,15 , 715,60 , 716,60 , 717,60 , 718,20, 719,20 , 720,20 , 721,20 , 722,20 , 723,20, 724,20 , 725,20 , 726,20 , 727,20 , 728,20, 729,20 , 730,16 , 731,14 , 732,12 , 733,50, 6077,20, 7300,20, 756,20 , 757,20 , 2794,5, 7049,70, 6078,70, 7067,70; set .@len, getarraysize(.@array); delitem 26105,1; if(rand(2)-1) { while(set(.@i,.@i+2)-2<.@len) if(rand(100)<=.@array[.@i-1]) { set .@item, .@array[.@i-2]; misceffect 795; soundeffect "mining.wav",0; progressbar "brown",2; misceffect 795; specialeffect2 610; getitem(.@item,1); mes "You successfully mined a "+getitemname(.@item)+"."; } } else { misceffect 795; soundeffect "mining.wav",0; progressbar "brown",2; misceffect 795; mes "You failed to mine."; specialeffect2 611; } close; } Edited August 6, 2013 by Skorm Quote Link to comment Share on other sites More sharing options...
Emistry Posted August 6, 2013 Group: Forum Moderator Topic Count: 93 Topics Per Day: 0.02 Content Count: 10018 Reputation: 2369 Joined: 10/28/11 Last Seen: Sunday at 05:32 PM Share Posted August 6, 2013 if(rand(100)<=.@array[.@i]) { set .@item, .@array[.@i]-1; change to if(rand(100)<=.@array[.@i+1]) { set .@item, .@array[.@i]; Quote Link to comment Share on other sites More sharing options...
Skorm Posted August 6, 2013 Group: Forum Moderator Topic Count: 33 Topics Per Day: 0.01 Content Count: 1282 Reputation: 393 Joined: 02/03/12 Last Seen: April 11 Share Posted August 6, 2013 (edited) if(rand(100)<=.@array[.@i]) { set .@item, .@array[.@i]-1; change to if(rand(100)<=.@array[.@i+1]) { set .@item, .@array[.@i]; Actually it should be: while(set(.@i,.@i+2)-2<.@len) if(rand(100)<=.@array[.@i-1]) { set .@item, .@array[.@i-2]; Good spot though I put this one together in under 5 minutes and somethings slipped my mind. Edited August 6, 2013 by Skorm Quote Link to comment Share on other sites More sharing options...
Question
xienne15
i am only getting the 26106 in the arrray. How to fix this?
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.