• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Action Farming Script

Nirer

New Member
Joined
Aug 23, 2007
Messages
91
Reaction score
0
Location
Israel, How Unfortunate
This script basically does the following:
You put a blueberry on proper ground (you decide which ground is proper) use a hoe (not a slut -.- ) on the blueberry and POOF a blueberry bush appears... The blueberry bush will disappear in xxx seconds which you provide...
like this:
YouTube - Nirer's Farming Script!

1)Go into you \data\actions\scripts\tools directory, then create a new file named "hoe" (.lua of course) and paste this inside:
PHP:
----------------Script By Nirer/Kakashi~Sensei----------------
-----------------------DO NOT COPY!-----------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
	 local grounds={106, 4529, 103, 3263} --Add more ground ID's of PROPER GROUNDS--
	 local time_of_tree_death_in_seconds=10 --Change it to whatever you want (set to 10 seconds and tree disappears)--
	   if(itemEx.itemid==2677 and itemEx.type==1) then
	       local ground_position={x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=0}
		   local ground_information=getThingfromPos(ground_position)
		     if(isInArray(grounds, ground_information.itemid)==TRUE) then
			    doTransformItem(itemEx.uid, 2785)
                   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congradulations! You got a nice BUSH!")
				     addEvent(treeDie, time_of_tree_death_in_seconds*1000, {position=toPosition})
				else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This is not the proper ground...")
			 end
		elseif(itemEx.type~=1) then
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may only grow one bush at a time.")	
	   end
  return TRUE
end
function treeDie(parameter)
  local tree=getThingfromPos{x=parameter.position.x, y=parameter.position.y, z=parameter.position.z, stackpos=1}
  doRemoveItem(tree.uid)
  end

adjust lines 4 and 5 to your server...

2) go into your \data\actions directory, open actions.xml and paste this:
PHP:
<action itemid="2552" script="tools/hoe.lua"/>

YOU'RE DONE!
ONLY BEEN TESTED ON TFS!
CREATED BY ME, DO NOT STEAL OR W/E...
 
Maybe make a normal bush appear at first, and then after 10-20 secs it will grow into a blueberry bush, and then a dead bush, then disappear? ;)
 
Ok! I'm finished! Empty.. I've done it! YEAH! here it is:
PHP:
----------------Script By Nirer/Kakashi~Sensei----------------
-----------------------DO NOT COPY!-----------------------
function onUse(cid, item, fromPosition, itemEx, toPosition)
	 local grounds={106, 4529, 103, 3263} --Add more ground ID's of PROPER GROUNDS--
	 local time_that_takes_tree_to_bloom_in_seconds=10 --Change it to whatever you want (set to 10 seconds and tree appears)--
	 local time_of_tree_death_in_seconds_after_tree_bloomed=10 --Change it to whatever you want (set to 10 seconds and tree disappears)--
	   if(itemEx.itemid==2677 and itemEx.type==1) then
	       local ground_position={x=toPosition.x, y=toPosition.y, z=toPosition.z, stackpos=0}
		   local ground_information=getThingfromPos(ground_position)
		     if(isInArray(grounds, ground_information.itemid)==TRUE) then
			    doTransformItem(itemEx.uid, 2786)
                   doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "Congradulations! You got a nice BUSH!")
				     addEvent(Bloom, time_that_takes_tree_to_bloom_in_seconds*1000, {position=toPosition, cid=cid, time_of_death=time_of_tree_death_in_seconds_after_tree_bloomed})
				         
				else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "This is not the proper ground...")
			 end
		elseif(itemEx.type~=1) then
             doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may only grow one bush at a time.")	
	   end
  return TRUE
end
function Bloom(parameter)
 
 local tree=getThingfromPos{x=parameter.position.x, y=parameter.position.y, z=parameter.position.z, stackpos=1}
    doTransformItem(tree.uid, 2785)
	  doPlayerSendTextMessage(parameter.cid, MESSAGE_INFO_DESCR, "Your tree has fully grown! Eat it fast before it dies!")
       	  addEvent(treeDie, parameter.time_of_death*1000, {position={x=parameter.position.x, y=parameter.position.y, z=parameter.position.z }, cid=parameter.cid})
end
function treeDie(parameter)
  local tree=getThingfromPos{x=parameter.position.x, y=parameter.position.y, z=parameter.position.z, stackpos=1}
  doRemoveItem(tree.uid)
  doPlayerSendTextMessage(parameter.cid, MESSAGE_INFO_DESCR, "Your tree died...")
  end
 
Good job, Nirer! ;)

A lot cooler when the tree grows up, than just simply pop up, eat berries, bush disappears.

Also, maybe an exhaust on that? Since 0.2 doesn't have the talkaction exhaust in talkactions.xml... ;)
 
Good job, Nirer! ;)

A lot cooler when the tree grows up, than just simply pop up, eat berries, bush disappears.

Also, maybe an exhaust on that? Since 0.2 doesn't have the talkaction exhaust in talkactions.xml... ;)

Since when function onUse goes to talkactions?
 
I think you hurt him... now say sorry and make up :D
anyways I didn't understand what u meant Empty..

edit:
guys if u rep me.. i rep u back :D

Exhaust so that you can only use the hoe once every minute or something.
 
Back
Top