Page 1 of 1

change Lootomatic Setting at start Macro

Posted: Tue Jul 31, 2012 3:37 pm
by Ballerlocke
change Lootomatic Setting at start Macro (In Onload)


i have search for the setting and how i can take her in a macro but i dont get it start.
i wont a standart setting if i start a specific macro with this settings

Lootomatic = Enabled
Roll: Normal
Autoloot: rare/loot Boss
Autopass: Never
Autogreed: Rare

thanks for help

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 01, 2012 8:53 am
by rock5
I think they might be

Code: Select all

RoMScript("} 
    Lootomatic_Settings.Enabled = true;
    Lootomatic_Settings.Roll = 3; -- 'Normal'
    Lootomatic_Settings.AutoLoot = 5; -- 'Rare'
    Lootomatic_Settings.AutoLootBoss = true;
    Lootomatic_Settings.AutoPass = 1; -- 'never'
    Lootomatic_Settings.AutoGreed = 5; -- 'Rare'
a={")
I think that should work.

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 01, 2012 3:18 pm
by Ballerlocke
no Rock if i copie this in the ONLOAD Line he brakes up when i load the macro

Re: change Lootomatic Setting at start Macro

Posted: Thu Aug 02, 2012 6:16 am
by lisa
Ballerlocke wrote: if i copie this in the ONLOAD Line he brakes up when i load the macro
When you say macro do you mean when you start the bot?

what do you mean by "he brakes up"

Also maybe try it without the comments

Code: Select all

RoMScript("} 
    Lootomatic_Settings.Enabled = true;
    Lootomatic_Settings.Roll = 3;
    Lootomatic_Settings.AutoLoot = 5;
    Lootomatic_Settings.AutoLootBoss = true;
    Lootomatic_Settings.AutoPass = 1;
    Lootomatic_Settings.AutoGreed = 5;
a={")  
Does it stay under the 255 characters ?

Re: change Lootomatic Setting at start Macro

Posted: Thu Aug 02, 2012 7:13 am
by rock5
lisa wrote:Does it stay under the 255 characters ?
Good point. I believe with comments it is well over 255. Without comments it should be about 230-240.

Re: change Lootomatic Setting at start Macro

Posted: Thu Aug 02, 2012 7:26 am
by lisa
could always just do it in 2 lots

Code: Select all

RoMScript("} 
    Lootomatic_Settings.Enabled = true;
    Lootomatic_Settings.Roll = 3;
    Lootomatic_Settings.AutoLoot = 5;
a={")  

Code: Select all

RoMScript("} 
    Lootomatic_Settings.AutoLootBoss = true;
    Lootomatic_Settings.AutoPass = 1;
    Lootomatic_Settings.AutoGreed = 5;
a={")  

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 15, 2012 3:09 am
by Jandrana
Hm - the above examples did not work for me. I even don't understand parts of the code. Why this:
a={
at the end of the assignments?

But I found another solution. Add this function to the end of main.lua of the lootomatic addon:
function Lootomatic.Func.Enable(aBool, roll, autoloot, autolootBoss, autopass, autogreed)
Lootomatic_Settings.Enabled = aBool;
Lootomatic_Settings.Roll = roll;
Lootomatic_Settings.AutoLoot = autoloot;
Lootomatic_Settings.AutoLootBoss = autolootBoss;
Lootomatic_Settings.AutoPass = autopass;
Lootomatic_Settings.AutoGreed = autogreed;
end;
Then you can put something like this in your MM scripts:

Code: Select all

RoMScript("Lootomatic.Func.Enable(true,3,5,true,3,1);")

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 15, 2012 3:19 am
by lisa
making your own function would work =)


As for the a ={

you can easily call functions but if you want to change in game variables you need to have them between this

Code: Select all

}
--some variable
a={
As to why it didn't work did you try just changing a couple at a time, there is a 255 character limit for macros.

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 15, 2012 4:00 am
by rock5
Jandrana wrote:Hm - the above examples did not work for me. I even don't understand parts of the code. Why this:
a={
at the end of the assignments?
Basically, when you run a RoMScript, the commands get put into a table as part of it's code and then the values in the table get returned. eg.

Code: Select all

RoMScript("GetZoneID()")
will equate to

Code: Select all

a = {GetZoneId()}
which works fine because GetZoneID() will return a value that will be placed in the table.

If on the other hand you try to run some code eg.

Code: Select all

RoMScript("SomeVariable = true")
What happens then is this

Code: Select all

a = {SomeVariable = true}
Which will simple create a sub value to a a.SomeVariable = true which is not what we want.

To execute any code you need to prefix with } and end with a={ . So

Code: Select all

RoMScript("} SomeVariable = true a={")
equates to

Code: Select all

a={} SomeVariable = true a={}
which is valid code that assigns true to SomeVariable.

If you want to return any value, you have to assign it to a in a table because that is the value it returns. For example my old ItemQueusCount function that counts the items in the incoming item queue.

Code: Select all

function ItemQueueCount()
	return RoMScript("} a = 20 while GetItemQueueInfo(a) == nil do a=a-1 if a==0 then break end end a ={a} z={")
end
This loops through each item until it finds how many items there are. It puts a in a table and because we don't want to wipe the value in a we use another variable to close the } bracket by using z={

That's fairly technical. All you need to know is if you want to change a value in game you have to start the RoMScript command with a } and end with a a={

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 15, 2012 7:50 am
by Jandrana
Thank you for your explanation, rock!

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 15, 2012 7:00 pm
by kuripot

Code: Select all

function Lootomatic.Func.Enable(aBool, roll, autoloot, autolootBoss, autopass, autogreed)
Lootomatic_Settings.Enabled = aBool;
Lootomatic_Settings.Roll = roll;
Lootomatic_Settings.AutoLoot = autoloot;
Lootomatic_Settings.AutoLootBoss = autolootBoss;
Lootomatic_Settings.AutoPass = autopass;
Lootomatic_Settings.AutoGreed = autogreed;
end;
how can i make it userfunction?? so i dont need to put whole function in onload...

i just to paste inside .Lua file? nad rename like this?? "userfunction_lootomatic.lua" ??

Re: change Lootomatic Setting at start Macro

Posted: Wed Aug 15, 2012 7:48 pm
by lisa
kuripot wrote:i just to paste inside .Lua file? nad rename like this?? "userfunction_lootomatic.lua" ??
Nope

What Jandrana did was edit the actual addon files, you could probably make up a userfunction to do it, it would be similar to the code I posted earlier just doing some RoMScript