transfering variables from one .cml to other

Additional botting resources. Addons may be either for the game itself or for the RoM bot.
Forum rules
Only post additional bot resources here. Please do not ask unrelated questions.
Post Reply
Message
Author
Edz
Posts: 10
Joined: Wed Oct 22, 2014 10:44 am

transfering variables from one .cml to other

#1 Post by Edz » Sun Dec 07, 2014 3:28 pm

Hallo,

is it possible to transfer one global variable into the next xml file.

User avatar
BlubBlab
Posts: 948
Joined: Fri Nov 30, 2012 11:33 pm
Location: My little Pony cafe

Re: transfering variables from one .cml to other

#2 Post by BlubBlab » Sun Dec 07, 2014 5:05 pm

What do you mean by that? In theory you can save a var in a file between the run of 2 files. :ugeek:
Yeah I know this would be a lot of overhead I wrote an extension for MM2 which would solve it for that but for MM and RomBot I don't see an easy solution.
Jack-of-all-trades, but master-of-only of a few :D

My Reps:
https://github.com/BlubBlab/Micromacro-with-OpenCV (My version of MM2 with OpenCV and for MS Visual Studio)
https://github.com/BlubBlab/rom-bot (rombot with no stop WP and advanced human emulation mode and some other extensions)
https://github.com/BlubBlab/Micromacro-2-Bot-Framework ( A work in progress )
My Tools : viewtopic.php?f=10&t=6226

User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: transfering variables from one .cml to other

#3 Post by rock5 » Sun Dec 07, 2014 8:40 pm

An easy solution would be to keep all the values you want to keep in a table then save the table using the table.save command, eg.

Code: Select all

table.save(mySavedValues,"filename.txt")
Then when you want to load them again use

Code: Select all

mySavedValues = table.load("filename.txt")
  • Please consider making a small donation to me to support my continued contributions to the bot and this forum. Thank you. Donate
  • I check all posts before reading PMs. So if you want a fast reply, don't PM me but post a topic instead. PM me for private or personal topics only.
  • How to: copy and paste in micromacro
    ________________________
    Quote:
    • “They say hard work never hurt anybody, but I figure, why take the chance.”
          • Ronald Reagan

Edz
Posts: 10
Joined: Wed Oct 22, 2014 10:44 am

Re: transfering variables from one .cml to other

#4 Post by Edz » Wed Dec 10, 2014 1:34 am

Thanks Rock.

Sry for my bad english but know what i meen :D

User avatar
Bot_romka
Posts: 96
Joined: Tue Apr 05, 2011 2:59 am
Location: Russia

Re: transfering variables from one .cml to other

#5 Post by Bot_romka » Sat Dec 13, 2014 12:42 am

I used userfunction addon_Variables.lua and include there all needed global Variables.

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest