course of terror WP

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.
Message
Author
User avatar
rock5
Posts: 12173
Joined: Tue Jan 05, 2010 3:30 am
Location: Australia

Re: course of terror WP

#341 Post by rock5 » Thu Nov 01, 2012 1:39 am

So if I understand correctly the repeat ticket allows you to repeat all Malatina games. I'd use a separate file so you don't have to modify the cot script, just in case the cot script gets updated or you want to change things around. It will be easier with a separate file.

[MalatinaRepeat.xml outdated version removed]

I just did some cut and pasting and came up with this.
It's sort of like my 'survivalnext' and can probably be used the same. It is completely untested and is specifically designed for your needs. It only works on English clients and only uses the one type of ticket. It can be modified later if other people want to use it.

Like my other files it can be controlled by the options. Let me know if you don't understand any of them.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: course of terror WP

#342 Post by CanceR » Sat Nov 03, 2012 12:22 pm

any idea how to make following code as usefunction:

Code: Select all

function checkRelog()
		-- Log result
		local filename = getExecutionPath() .. "/logs/cot.log";
		local file, err = io.open(filename, "a+");
		if file then
			file:write("Date: " .. os.date() .."\tAccount: "..RoMScript("GetAccountName()").."\tName: " ..string.format("%-10s",player.Name )..
			" \tShells gained/total: "..inventory:getItemCount(240181) - numshells.."/".. inventory:getItemCount(240181).. "\t" ..logentry .. "\n")
			file:close();
		end
because if I just paste is in userfuction, "logentry" generates error.
i just want to make userfunction, to be used to log info for how much time are done my daily quests and to log that amount of time. Bellow code is not working correctly:

Code: Select all

function LogToFileDQ(_message, _filename)
	-- Log result
	local filename = getExecutionPath() .. _filename;
	local file, err = io.open(filename, "a+");
	if file then
		file:write("Date: " .. os.date() .."\tAccount: "..RoMScript("GetAccountName()").." \tChar No: "..RoMScript("CHARACTER_SELECT.selectedIndex").."\tName: " ..string.format("%-10s",player.Name ).."\t DQ's '".._message.."' completed".."\t" ..logentry .. "\n")
		file:close();
	end
end
can i ask for some correction/explanation, please?
or how to add third parameter, depending on which - to add or not to add data for time of completition?

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

Re: course of terror WP

#343 Post by rock5 » Sat Nov 03, 2012 12:42 pm

In that example, it looks like 'logentry' has no value.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: course of terror WP

#344 Post by CanceR » Sat Nov 03, 2012 1:33 pm

i found my misunderstanding. "logentry" uses data from "TimeKeeperFrame.startTime-GetTime()" to show only time left from Malatina mini game, and will not be usefull for my case.
then next idea: how to organize a timer inside a waypoint? to start counting time from start of waypoint and to assign amount of passed time, somewhere later in same waypoint? and later to be able to log that passed time value

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

Re: course of terror WP

#345 Post by rock5 » Sat Nov 03, 2012 2:03 pm

Just save the current time. There are a few time functions. Eg.

Code: Select all

starttime = os.clock()
Then later when you want to know how much time has passed you can go

Code: Select all

elapsedtime = os.clock() - starttime
os.clock() is in seconds.
  • 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

CanceR
Posts: 33
Joined: Sun Jul 22, 2012 9:28 am

Re: course of terror WP

#346 Post by CanceR » Sun Nov 04, 2012 6:58 am

i tried to steal some code from cot.xml

Code: Select all

	starttime = os.clock();
and later in WP code:

Code: Select all

	elapsedtime = os.clock() - starttime;
	local mm = string.format("%02s", math.floor(elapsedtime/60))
	local ss = string.format("%02s", math.floor(math.mod(elapsedtime, 60)))
	logentry = string.format("in %s:%s ",mm,ss);
but text in log file says: " in 00:02" - i think it does not calculate minutes, only seconds (may be). any advices?

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

Re: course of terror WP

#347 Post by rock5 » Sun Nov 04, 2012 7:11 am

It worked for me.

Code: Select all

        RomBot command line
Type in 'q' (without quotes) to quit.
Command> elapsedtime = 65
Command> mm = string.format("%02s", math.floor(elapsedtime/60))
Command> ss = string.format("%02s", math.floor(math.mod(elapsedtime, 60)))
Command> logentry = string.format("in %s:%s ",mm,ss);
Command> print(logentry)
in 01:05
Maybe it really did take 2 seconds.
  • 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

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: course of terror WP

#348 Post by Cindy » Tue Nov 13, 2012 5:01 pm

Ok, there are multiple repeater tickets...

One allows both to repeat (this is the awesome one)
One allows repeat of COT
One allows repeat of Survivor game.

Malatina Event Repeat Ticket - repeats both
Malatina's Dungeon Repeat Ticket (im not sure if this is COT or survivor)

I don't know what the third is called, because I don't have one at the moment.

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

Re: course of terror WP

#349 Post by rock5 » Tue Nov 13, 2012 11:30 pm

Cindy wrote:Ok, there are multiple repeater tickets...
Is this a request to add support for them in malatinarepeat? So how do we want it to work? Just use whichever ones it finds otherwise leave everything else as it is?

Using InventoryPreview addon I can find the following tickets
  • Malatina Event Repeat Ticket
    Malatina's Event Repeat Ticket (1 Day)
    Malatina's Dungeon Repeat Ticket
    Malatina's Dungeon Repeat Ticket (1 Day)
    Malatina's Course of Terror Repeat Ticket
    Malatina's Course of Terror Repeat Ticket (1 day)
  • 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

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: course of terror WP

#350 Post by Cindy » Wed Nov 14, 2012 4:15 pm

The important thing is that you don't want to use the one that resets both until you have done both. Logistically it means loading the WP files for the one(s) you have reset involves some decision making logic.

And yes the IP listing seems right, although I have no idea how the (1 day) one differs.

I was thinking along these lines and a question came up, can the 'chaining' mechanism be improved, so that execution returns to the calling script (at the called location) upon completion of the called script?

User avatar
lisa
Posts: 8332
Joined: Tue Nov 09, 2010 11:46 pm
Location: Australia

Re: course of terror WP

#351 Post by lisa » Wed Nov 14, 2012 5:31 pm

just make up a "control" WP which is onload only that will make the decisions of what WP to load.

At the end of each WP you use make sure it gets back to the same spot and you do the loadpath of the control WP.

You can keep track of what has been done using global values.

example in the survival WP you could add the characters name to a table for survival.

in the control WP you can look in that table to see if the character has done the WP or not.

Something to remember though, you need to have a table defined in order to insert info into it but if you define the table each time you run the control WP it will clear old data.
A few ways around it.

Code: Select all

if survivaltable == nil then survivaltable = {} end
that will check if it exists and if not then it will define it as a table, just remember to use unique names as if there is a function, value or table for the name elsewhere then it won't be nil lol

hope I didn't confuse you to much.
Remember no matter you do in life to always have a little fun while you are at it ;)

wiki here http://www.solarstrike.net/wiki/index.php?title=Manual

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

Re: course of terror WP

#352 Post by rock5 » Wed Nov 14, 2012 10:35 pm

Cindy wrote:The important thing is that you don't want to use the one that resets both until you have done both. Logistically it means loading the WP files for the one(s) you have reset involves some decision making logic.
I wasn't going to do any decision making. I was just going to use a ticket then repeat the games. Eg.
survival -> cot -> malatinarepeat (use a ticket) -> survival -> cot -> malatinarepeat (no more tickets) -> next file
That might mean you try repeating a game you have already done but the scripts can handle that and will skip the game if already done. I guess if I don't have a double game ticket it will try to use 1 ticket of each game before repeating.
Cindy wrote:And yes the IP listing seems right, although I have no idea how the (1 day) one differs.
I think I'll ignore the 1 days as it will require different programming and I don't know how they work. If someone ever gets one of these then we'll see.
Cindy wrote:I was thinking along these lines and a question came up, can the 'chaining' mechanism be improved, so that execution returns to the calling script (at the called location) upon completion of the called script?
Lisa explains how it could be done but I find the idea more trouble than it's worth trying to keep track of where it's up to. I do sometimes use a starting script though, that makes some decisions on how to start, which chains to use, where to start in the chain, etc.
  • 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

Cindy
Posts: 237
Joined: Fri Sep 28, 2012 4:23 pm

Re: course of terror WP

#353 Post by Cindy » Thu Nov 15, 2012 9:58 am

I guess what I was thinking of is being able to have an optimized route (minimum ports to minimize crashes?) and as i go along I can do different things (even load an event specific sub-loop for example), and always return control to the main function (sort of like how software execution path goes).

Phase two of this plan involves logging as I move along, so when crashes happen I can recover progress so far from the log files, and continue the grind loop.

This of course relies on success in the work that someone else here is doing on being able to re-launch rom, and start character, etc.

harbifm
Posts: 135
Joined: Wed May 25, 2011 11:43 pm

Re: course of terror WP

#354 Post by harbifm » Sun Dec 02, 2012 6:25 am

thanks Rock, the maltina repat worked,
tried for like 20 times, where i rune leave for 2 hourse, come back where ther is almsot 1000 shells


but yeasterday, when I left the pc overnight , it choged 40 tickets :|

it may run out of phirous tokkens or something, but somthing went wrong unfortent :roll:

so everyone be carfull with the repeat waypoint

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

Re: course of terror WP

#355 Post by rock5 » Sun Dec 02, 2012 7:16 am

You make a good point. It would have to check if you have enough coins. I forgot how many they need. How many coins does cot and survival need? Was it 30 for all games? I seem to remember something was different. Maybe it was the reward shells. Anyway, I'll add a check for them. I was also going to add code for the other types of tickets. Forgot all about it. I'll do that too.
  • 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

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

Re: course of terror WP

#356 Post by rock5 » Sun Dec 02, 2012 8:09 am

Ok, here is version 2. It checks to make sure you have enough coins before using tickets, it uses all 3 types of tickets, and it is now language independent. It's untested so let me know if it works.

[MalatinaRepeat.xml outdated version removed]

More details on how it uses the tickets:
  • - It first checks if you have a double event ticket and only uses that if you have 60 coins.
    - If you have 60 coins but no event ticket then it tries to use both survival and cot tickets
    - If you have only enough coins for one game it will try to use a cot or survival ticket but wont use both.
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: course of terror WP

#357 Post by kenzu38 » Sun Dec 02, 2012 9:15 am

Hi lisa, first of all, let me thank you for making this script. It's working really well for me. I'm using the cot_tele one btw.

I just have a small request though, hope you can help me. I want the script to also talk to the NPC (I think it's also Malatina?) to teleport out after getting all the chests. Can you add that as an option to your script?

Would really appreciate it if you can. Thanks.

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

Re: course of terror WP

#358 Post by rock5 » Sun Dec 02, 2012 10:50 am

Sort of like I did with AT? That should be easy. I'll just copy it and modify it.

Ok, took me a bit longer than I thought. My version had a lot of little modifications that I had to go through and decide if I'd include them.

I've added the option

Code: Select all

	ExitBeforeNextFile    = false	-- If you want it to exit game before loading next "waypointfilename".
I've defaulted it to "false" so if you want it to exit then set it to "true". Please try this version and let me know how it goes as I haven't tested it myself.
Attachments
cot_tele.xml
Version 1.80
(10.17 KiB) Downloaded 148 times
  • 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

kenzu38
Posts: 279
Joined: Sun Dec 02, 2012 8:52 am

Re: course of terror WP

#359 Post by kenzu38 » Sun Dec 02, 2012 1:15 pm

Hi rock5, thanks for sharing your scripts.

Your toat.xml file worked fine. Unfortunately, the cot_tele.xml did not. I tried it with 2 chars now, and the errors on both run were always on exiting COT. Log reports errors as: Option "I want to leave" not found. Option "Confirm" not found.

I had to click Malatina manually to leave but good thing is it still loads the next waypoint after I exit the minigame.

If the bot is the one that clicks Malatina, a different dialogue pops up with only the "Leave Conversation" option. If I click it manually, only then does the usual dialogue pop up.

Btw, I am using 5.0.5.2592 and updated Rombot and I wasn't lagging either.

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

Re: course of terror WP

#360 Post by rock5 » Sun Dec 02, 2012 1:56 pm

Sorry. wrong Malatina id. This should work.
cot_tele.xml
Version 1.81
(10.17 KiB) Downloaded 166 times
Also here is the MalatinaRepeat script with the updated id.
MalatinaRepeat.xml
Version 2.1
(2.86 KiB) Downloaded 152 times
  • 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

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests