Jump to content
  • 0

simple mining


xienne15

Question


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

I want to request a mining script.

 

This is how it works:

1) The player should have Pick (ID:25000)

    if (countitem(25000 > 1) {
It will mine different minerals with % chances

Minerals

25001 20% chance to get

25002 50% chance to get

25003 80% chance to get

25004 2% chance to get

 

there is also a chance that it will fail. 50%

 

2) When the player mined 25001 it will say after mining

mes "You successfully mined a 25001";
close;
 

and when the mined 25002 it will say

mes "You successfully mined a 25002";
close;
 

and so on

 

And when it failed to mine it will say

mes "You failed to mine.";
close;
 

After each use of the Pick 25000, it will be deleted

delitem 25000,1;
Edited by xienne15
Link to comment
Share on other sites

10 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  130
  • Topics Per Day:  0.03
  • Content Count:  528
  • Reputation:   18
  • Joined:  09/11/12
  • Last Seen:  

Where can the player mine? All over the worldmap or only at a special coord? 

The mine have to work as skill or usable item?

Edited by Thor v2
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

Where can the player mine? All over the worldmap or only at a special coord? 

The mine have to work as skill or usable item?

at only 1 coordinate since i will put it in a big rock inside izlude.

example is

izlude,123,123,4     script    MINING SPOT    111,{
Edited by xienne15
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

That's a lot to request I suggest you download previous mining scripts and ask for adjustments.

 

I did do something really quick but it's untested.

 

In Item 25000 script.

if(@mine) doevent("pickaxe::OnMine");

 

-	script	pickaxe	-1,{
OnMine:
	setarray .@array,	501, 20,
                        502, 50,
                        503, 80,
                        504, 2 ;
	set .@len, getarraysize(.@array);
	//delitem 25000,1;
	if(rand(2)-1) {
		while(set(.@i,.@i+2)-2<.@len)
			if(rand(100)<=.@array[.@i-1]) {
				set .@item, .@array[.@i-2];
				getitem(.@item,1);
				mes "You successfully mined a "+getitemname(.@item)+".";
			}
	} else
		mes "You failed to mine.";
	close;
}

izlude,123,123,4	script	MINING SPOT	111,2,2,{
end;
	OnTouch:
		getmapxy(.@map$,.@x,.@y,0);
		while(sqrt(pow([email protected],2)+pow([email protected],2))<=3) {
			sleep2 100;
			getmapxy(.@map$,.@x,.@y,0);
			set @mine, 1;
		}		
		set @mine, 0;
		end;

	OnInit:
		getmapxy(.nmap$,.nx,.ny,1);
}
Edited by Skorm
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  130
  • Topics Per Day:  0.03
  • Content Count:  528
  • Reputation:   18
  • Joined:  09/11/12
  • Last Seen:  

I thing you can add the messages by yourself. 

 

Btw not tested ;)-

 

izlude,123,123,4	script	Rock	111,{

if (countitem(25000) > 1) {

delitem 25000,1;
set .@change, rand (1, 100);
if (.@change < 3) {

		getitem 25004, rand(0, 1);
		
				}
	else if (.@change  < 21) {
		getitem 25001, rand(0, 1); 
							}
	else if (.@change  < 51) {
		getitem 25001, rand(0, 1); 
							}
			
	else	 {
			getitem 25003, rand( 0, 1); 
			
			}



} }
Edited by Thor v2
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

That's a lot to request I suggest you download previous mining scripts and ask for adjustments.

 

I did do something really quick but it's untested.

 

In Item 25000 script.

if(@mine) doevent("pickaxe::OnMine");
 
-     script    pickaxe    -1,{
OnMine:
	setarray .@array,	25001, 20,
						25002, 50,
						25003, 80,
						25004, 2 ;
	set .@len, getarraysize(.@array);
	delitem 25000,1;
	if(rand(2)-1)
		while(set(.@i,.@i+2)-2<=.@len)
			if(rand(100)<=.@array[.@i]) {
				set .@item, .@array[.@i]-1;
				getitem(.@item,1);
				mes "You successfully mined a "+.@item;
				close;
			}
	mes "You failed to mine.";
	close;
}

izlude,123,123,4     script    MINING SPOT    111,5,5,{
	OnTouch:
		getmapxy(.@map$,.@x,.@y,0);
		while(sqrt(pow([email protected],2)+pow([email protected],2))<=5) {
			sleep 100;
			getmapxy(.@map$,.@x,.@y,0);
			set @mine, 1;
		}
		set @mine, 0;
		
	OnPCLogoutEvent:
		set @mine, 0;

	OnInit:
		getmapxy(.nmap$,.nx,.ny,1);
}
hmmm

ekj0x4.jpg

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

Change

sleep 100;

To

sleep2 100;
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

Change

sleep 100;
To
sleep2 100;
how can i make it show item name instead of item id?

mes "You successfully mined a "+.@item;

this shows the number ID, not the item name.

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  


mes "You successfully mined a "+getitemname(.@item)+".";

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  44
  • Topics Per Day:  0.01
  • Content Count:  226
  • Reputation:   11
  • Joined:  01/09/12
  • Last Seen:  

mes "You successfully mined a "+getitemname(.@item)+".";
	getitem(.@item,1);

is the 1 responsible for the number of items given when successfully mining? why sometimes it gives more than 1 piece?

mes "You successfully mined a "+getitemname(.@item)+".";
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;
				getitem(.@item,1);
				mes "You successfully mined a "+getitemname(.@item)+".";
				close;
			}
	mes "You failed to mine.";
	close;
}

i tried to add item but it only gives the first item ID 26106

Edited by xienne15
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  33
  • Topics Per Day:  0.01
  • Content Count:  1268
  • Reputation:   382
  • Joined:  02/03/12
  • Last Seen:  

i tried to add item but it only gives the first item ID 26106

 

Use the version from my previous post I updated it awhile back.

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...