Awesome thanks for the reply.
I am barely scriptKiddy levels programmer lol, so I wasn't sure if I was missing something.
I plan to use this to finally script a few projects of my own and break away from the basic beginner programming tutorials. So Thanks so much for your work!
-
Paradoxs
- Posts: 294
- Joined: Tue Aug 25, 2015 7:16 am
Prime Update 0.3.2
Prime has been updated for World 10 (0.3.2)
Note: you need to update your client!
Fixes
Added
Note: you need to update your client!
Fixes
- useItem
Fixed a problem where useItem failed at certain cordinates
Added
- useItem
useItem when used on an object now accepts true or false for shift, for things like mass transfers and such
-
De_Luxe
- Posts: 7
- Joined: Mon May 19, 2014 9:26 pm
Re: Prime - Amber Tweaks and Scripting API
Guys how i can put some stuff from my inventory to container? drop("spindlytaproot",Inventory.Player,Prime.Inventory) not working. Also i have problems with placeStockpile(); can you give me example of use?
-
Paradoxs
- Posts: 294
- Joined: Tue Aug 25, 2015 7:16 am
Re: Prime - Amber Tweaks and Scripting API
De_Luxe wrote:Guys how i can put some stuff from my inventory to container? drop("spindlytaproot",Inventory.Player,Prime.Inventory) not working. Also i have problems with placeStockpile(); can you give me example of use?
Prime.Inventory is not a type of inventory Inventory holds all of the types of inventory
First off your mixing a few things:Prime..Inventory.Study
Pime.Inventory.Player
Prime.Inventory.Container
if you havent set a #primeObject you should not be using Prime.Inventory, you should be using Inventory.Type
Drop takes 3 arguments the ItemName, the Source Inventory, and the Destination
Source inventory is the Inventory the item is located so
(Currently doesnt allow you to Drop from a container directly, though this is fixed in the next versionInventory.Study
Inventory.Player
Destination is either an Inventory OR
This means you need to define the container by the window nameif To is a string it defines an Inventory.Container if To is an Inventory it drops into that inventory
So your code should be
Code: Select all
drop("spindlytaproot", Inventory.Player, "Crate");-
De_Luxe
- Posts: 7
- Joined: Mon May 19, 2014 9:26 pm
Re: Prime - Amber Tweaks and Scripting API
Gtreat ty! But i have more questions: how i can getItems() only with they names? Like getItems(Name); and how i can get all Items from cupboard?
-
iamahh
- Posts: 1806
- Joined: Sat Dec 12, 2015 8:23 pm
Re: Prime - Amber Tweaks and Scripting API
getMapObjects could take an argument to sort by distance, name, etc...
-
Paradoxs
- Posts: 294
- Joined: Tue Aug 25, 2015 7:16 am
Re: Prime - Amber Tweaks and Scripting API
already added for next version, sorts by distance, name, and id, including reverse ordersiamahh wrote:getMapObjects could take an argument to sort by distance, name, etc...
-
ae_maderero
- Posts: 7
- Joined: Fri Jan 13, 2017 4:48 pm
Re: Prime - Amber Tweaks and Scripting API
How do you modify an object coordinate?
What I'm trying to archieve:
But it does nothing. When I modify Character coords, it works.
What I'm trying to archieve:
Code: Select all
var obj = getHighlightedMapObjects();
goTo(obj.Coords.x +10, obj.Coords.y +10);-
kacper022
- Posts: 4
- Joined: Fri Feb 24, 2012 6:38 pm
Re: Prime - Amber Tweaks and Scripting API
ae_maderero wrote:How do you modify an object coordinate?
What I'm trying to archieve:But it does nothing. When I modify Character coords, it works.Code: Select all
var obj = getHighlightedMapObjects(); goTo(obj.Coords.x +10, obj.Coords.y +10);
Try this:
Code: Select all
var obj = getHighlightedMapObjects();
goTo(obj.x+10, obj.y+10);-
ae_maderero
- Posts: 7
- Joined: Fri Jan 13, 2017 4:48 pm
Re: Prime - Amber Tweaks and Scripting API
Nothing. Not even without modifying the coords. The weird thing is pfClick(object) does work.kacper022 wrote: Try this:Code: Select all
var obj = getHighlightedMapObjects(); goTo(obj.x+10, obj.y+10);
Actual code:
Code: Select all
function main() {
var ZonaDescarga = askFor('Selecciona con Alt+Click el punto de descarga de los materiales');
goTo(ZonaDescarga.x, ZonaDescarga.y);
waitForPf();
exit();
}
function askFor(msg, who) {
var channel = (who != undefined) ? Channel.Private : undefined;
chat(msg, channel, who);
var object = undefined;
while (object == undefined){
var element = getHighlightedMapObjects();
if (element[0] !== undefined)
object = element[0]
sleep(100);
}
chat('Objeto obtenido', channel, who);
sleep(1000);
return object;
}