Page 19 of 23

Re: course of terror WP

Posted: Sun Dec 02, 2012 3:37 pm
by kenzu38
Thanks a lot for the files. It's all working fine now.

Also downloaded the Malatinarepeat, though I think this will hardly be used as the event repeat tickets are pretty rare. :)

Anyway, if you're not busy, have one more request and that is to optimize the toat xml file so that it has an option to also buy diamonds from Cedric.

Again, thanks a lot for those files you shared. Cheers!

Re: course of terror WP

Posted: Mon Dec 03, 2012 3:02 am
by rock5
kenzu38 wrote:Anyway, if you're not busy, have one more request and that is to optimize the toat xml file so that it has an option to also buy diamonds from Cedric.
Hm... ok. Now how should it work? Diamonds are shared on an account so I'm thinking of an option where you specify which accounts should buy diamonds. Or you can use "all" to mean all accounts should buy diamonds. What do you think?

Re: course of terror WP

Posted: Mon Dec 03, 2012 4:58 am
by kenzu38
Yes, sure, no objections here. :)

And maybe you can also include the charlist feature from your other scripts so I can specify which specific chars will buy diamonds.

Also, I don't know if the bot is capable of this, but if it can, then I request you also put a code to run a check if the account has already reached the limit for diamond bought that day? So while the limit is not reached it will keep on buying diamonds.

I'm just thinking, it's only once a day now but if they do decide to get it back to 5 diamonds three times a day or even put up new numbers in the future, there will be no need to update this waypoint.

Thanks.

Re: course of terror WP

Posted: Mon Dec 03, 2012 5:54 am
by Rickster
I have a WP file walking by to the diamond NPC and a userfunction to buy the diamonds.
I have all my chars walking by and trying to buy diamonds without excluding any charnames, as I am not always using the same or all chars of an account running this WP file.
The userfunction handels, how many times it buys diamonds. This is set up manually by default values in the userfunction, so has to be updated there, when changes are made to the game, or by function arguments.

Code: Select all

------------------------------------------------
-- buyDiamonds(_byThisManyTimes, _debug_mode)
-- Description: This will buy diamonds at the npc Cedric in Varanas
--   be sure that your char stands near Cedric when calling this userfunction
-- Default usage: buyDiamonds()
--   this will buy diamonds at Cedric one time
-- default times to buy diamonds can be set in the userfunction below
-- Additional arguments:
--  _byThisManyTimes 	-- how many times you want to buy diamands, defaults to 1
--  _debug_mode 		-- true/false, defaults to false
--						-- prints a message before buying and sleeps until key is pressed to continue
------------------------------------------------
function buyDiamonds(_byThisManyTimes, _debug_mode)
	-- default settings
	local byThisManyTimes = 1  -- defaults to buy diamonds one time
	-- end default settings
	
	if not _byThisManyTimes then _byThisManyTimes = byThisManyTimes end
	if not _debug_mode then _debug_mode=false end

	local name_npc = GetIdName(115815); -- Cedric in Varanas
	
	if _debug_mode then
		cprinf_ex("|purple| DEBUG - Going to buy diamonds %s times at %s ...\n", _byThisManyTimes, name_npc)
		player:sleep()
	end
	
	cprintf_ex("|lightgreen| Buying diamonds ...\n");
	for i=1, _byThisManyTimes do
		if player:target_NPC(name_npc) then
			sendMacro("ChoiceOption(1);");	yrest(500);
			sendMacro("CloseWindows()");	yrest(500);
		else
			cprintf_ex("|lightred| NPC not found! Not buying diamonds. Be sure to be near %s in Varanas when trying to buy diamnods.\n", name_npc)
			break
		end
	end;
end

Re: course of terror WP

Posted: Mon Dec 03, 2012 6:06 am
by rock5
kenzu38 wrote:And maybe you can also include the charlist feature from your other scripts so I can specify which specific chars will buy diamonds.
Why limit to only certain characters on an account? I was going to make it so you can specify which accounts you want diamonds on. Isn't the idea that you want to buy as many diamonds as possible? Therefore you would want all the characters on that account to buy diamonds.
kenzu38 wrote:Also, I don't know if the bot is capable of this, but if it can, then I request you also put a code to run a check if the account has already reached the limit for diamond bought that day? So while the limit is not reached it will keep on buying diamonds
I don't really see how it's possible. I'll probably just leave it to try regardless. It wont waste much time.
Rickster wrote:I have a WP file walking by to the diamond NPC and a userfunction to bye the diamonds.
This would have saved me some time if I had not already written it. Functionally it's not too different to what I already wrote.

Re: course of terror WP

Posted: Mon Dec 03, 2012 6:52 am
by kenzu38
Why limit to only certain characters on an account? I was going to make it so you can specify which accounts you want diamonds on. Isn't the idea that you want to buy as many diamonds as possible? Therefore you would want all the characters on that account to buy diamonds.
I have accounts where there are only 2 chars with high enough level to buy diamonds and the rest are like level 1 storage chars so I was thinking that for those accounts, I would like to specify which chars to login so the bot will not have to waste time logging in the other chars that can't buy diamonds.
I don't really see how it's possible. I'll probably just leave it to try regardless. It wont waste much time.
I see. Nvm then if this is impossible. But like I said before, I like the code to be able to adapt to the daily limits so if it's not too much to ask, maybe you can make a user options line in the code where I can set how many times a char tries to buy diamonds from Cedric.

@Rickster

Hi, thanks for sharing your code. Unfortunately, I'm not good with coding so I don't know how to insert your code into rock5's toat xml file.

But really, thanks for sharing. :)

Re: course of terror WP

Posted: Mon Dec 03, 2012 7:20 am
by Rickster
kenzu38 wrote:I have accounts where there are only 2 chars with high enough level to buy diamonds and the rest are like level 1 storage chars so I was thinking that for those accounts, I would like to specify which chars to login so the bot will not have to waste time logging in the other chars that can't buy diamonds.
If you are relogging with Rocks fastLogin you can define a set of chars cross accounts, and use the wp file to buy the diamonds.
But when I followed your idea right, you want a WP file to go from Malatina to AT, and I guess you wount have lvl 1 chars doing this. So there will be no need to filter out low level chars when buying diamonds.

I agree with
rock5 wrote:I don't really see how it's possible. I'll probably just leave it to try regardless. It wont waste much time.
Thats the way I do it too. Walk by with every char and try to buy. if you already bought diamonds with a char from the same account, it does not matter, it just don´t get diamonds.
kenzu38 wrote:thanks for sharing your code. Unfortunately, I'm not good with coding so I don't know how to insert your code into rock5's toat xml file.
Nevermind, it was just my way of doing this task and you can feel free to use, what you are able to ;)

Ric

Re: course of terror WP

Posted: Mon Dec 03, 2012 7:23 am
by rock5
kenzu38 wrote:I have accounts where there are only 2 chars with high enough level to buy diamonds and the rest are like level 1 storage chars so I was thinking that for those accounts, I would like to specify which chars to login so the bot will not have to waste time logging in the other chars that can't buy diamonds.
This file is meant to be just a travel file that takes you from Malatina games to AT that buys diamonds along the way if it can. This file doesn't relog. It's up to the last file in your chain to do the relog, such at the survivalnext file. That's where you would decide which characters to log in.

This is what it looks like at the moment.

<<< File deleted. Now it has a home at http://www.solarstrike.net/phpBB3/viewt ... 357#p35357 >>

Re: course of terror WP

Posted: Mon Dec 03, 2012 12:14 pm
by kenzu38
rock5 wrote:This file is meant to be just a travel file that takes you from Malatina games to AT that buys diamonds along the way if it can. This file doesn't relog. It's up to the last file in your chain to do the relog, such at the survivalnext file. That's where you would decide which characters to log in.
I see. So this will be dependent on the settings of other waypoint files?

When you said you were going to put options that specify which accounts were buying diamonds, I assumed you were going to put some logging commands directly into the toat xml file that's why I requested for the charlist feature to be there too. :)

Well, my main concern is that I should be able to specify which chars will buy, and it turns out I have control of that. So no complaints here.

Anyway, I just tested the file you posted and ran it with 2 chars. Both runs worked fine. The option to set number of times it buys diamonds is working as it should. Thanks a lot for this!
Rickster wrote:If you are relogging with Rocks fastLogin you can define a set of chars cross accounts, and use the wp file to buy the diamonds. But when I followed your idea right, you want a WP file to go from Malatina to AT, and I guess you wount have lvl 1 chars doing this. So there will be no need to filter out low level chars when buying diamonds.
Yeah, a complete misunderstanding on my part on how the script works. :)
Rickster wrote:Thats the way I do it too. Walk by with every char and try to buy. if you already bought diamonds with a char from the same account, it does not matter, it just don´t get diamonds.
I see. Well, it's just that I noticed there's a dqcount function that the bot uses and I suppose this one interacts with the game client to ask how many daily quest the char still has left, so I was wondering if there was something similar for diamonds.

Re: course of terror WP

Posted: Mon Dec 03, 2012 5:15 pm
by Cindy
rock5 wrote:
kenzu38 wrote:I have accounts where there are only 2 chars with high enough level to buy diamonds and the rest are like level 1 storage chars so I was thinking that for those accounts, I would like to specify which chars to login so the bot will not have to waste time logging in the other chars that can't buy diamonds.
This file is meant to be just a travel file that takes you from Malatina games to AT that buys diamonds along the way if it can. This file doesn't relog. It's up to the last file in your chain to do the relog, such at the survivalnext file. That's where you would decide which characters to log in.

This is what it looks like at the moment.

Ahah, great minds think alike? I've made and used a WP to get me from malatina to at, load the at script, get it done, then go to snoop, port to OS, Varanas, Silverfall and do goblins :)

Re: course of terror WP

Posted: Thu Jan 03, 2013 3:01 pm
by kenzu38
Hey guyz, need help with scripting.

You see, I want to skip looting the ordinary chests and only open the 2 special ones.

So I want to know how I should edit the following code to do just that:

Code: Select all

		elseif currentRoom() > 4 then -- Finished. Open chests
			--=== Create table for chests ===--
			chests = {left = {}, right = {}}

			local objectList = CObjectList();
			objectList:update();
			local objSize = objectList:size()

			for i = 0,objSize do
				local obj = objectList:getObject(i);
				if obj.Id == 113114 or obj.Id == 113137 then
					if obj.X > 4081 then -- right side
						table.insert(chests.right, table.copy(obj))
					else -- left side
						table.insert(chests.left, table.copy(obj))
					end
				end
			end

			-- Sort chests
			table.sort(chests.left, function(a,b) return b.Z > a.Z end)
			table.sort(chests.right, function(a,b) return a.Z > b.Z end)

			-- Get left side
			for k,v in pairs(chests.left) do
				player:target(v.Address);
				Attack()
				yrest(2000)
				Attack()
				if k == 1 then yrest(2000) Attack() end
				repeat
					yrest(2000)
					player:update()
				until not player.Casting
				repeat yrest(500) player:update() until player.Stance== 0
			end

			-- Get right side
			for k,v in pairs(chests.right) do
				player:target(v.Address);
				Attack()
				yrest(2000)
				Attack()
				if k == 1 then yrest(2000) Attack() end
				repeat
					yrest(2000)
					player:update()
				until not player.Casting
				repeat yrest(500) player:update() until player.Stance== 0
			end
Thanks.

Re: course of terror WP

Posted: Thu Jan 03, 2013 8:26 pm
by lisa
find this bit of code

Code: Select all

if obj.Id == 113114 or obj.Id == 113137 then
that is for the 2 types of chests, remove one of them and see if you only do thechests you want, if not then switch it so the other Id remains and you will get what you want or you could start MM with commandline and do

Code: Select all

print(GetIdName(113114))

and see which name is printed. Basically you just use the Id you want.

Re: course of terror WP

Posted: Fri Jan 04, 2013 2:03 am
by rock5
I think they are both called "Treasure Chest" according to runesdatabase.

Re: course of terror WP

Posted: Fri Jan 04, 2013 11:13 am
by kenzu38
rock5 wrote:I think they are both called "Treasure Chest" according to runesdatabase.
Yep, checked it using the commandline like lisa suggested. They're both named Treasure Chest.
lisa wrote:find this bit of code

Code: Select all

if obj.Id == 113114 or obj.Id == 113137 then
Thanks a lot, lisa! I got it working now.

And for those who want to know, special chest = 113137.

Re: course of terror WP

Posted: Mon Jan 21, 2013 10:29 am
by kenzu38
Hey rock, maybe because of the lag or something, there are some rare cases when the pink tiles are directly next to the portal, and when it's like that, the monster sometimes pops up and the char gets stuck after that. It doesn't go into the portal and it doesn't seem to kill the monster or probably can't kill it coz of the obstacle thing. Is there anything I can add to the code to ensure it doesn't get stuck when this happens?

Also, like in the AT waypoint, the char doesn't get ressed when the char gets killed by the monster that pops up. Anything I can add to the code for this problem?

Thanks.

Re: course of terror WP

Posted: Mon Jan 21, 2013 11:00 am
by rock5
If it happens rarely I wouldn't bother. It's not supposed to trigger the tile near the portal but even if it did, it's coming down from above and should go straight through even if it gets aggro.

Again, it's not supposed to be triggering monster tiles so I don't know how you are dying from them. I think there is a models file somewhere that removes all the non needed tiles which reduces the chance of triggering unwanted tiles.

Re: course of terror WP

Posted: Tue Jan 22, 2013 12:21 am
by Bot_romka
New another version of Course of Terror WP by Bot_romka.
Version 1.4.1
--without use swim hack, teleport hack (for teleport player) or model hack. Based on Rock5's cot_tele V1.72
--for enable speed hack uncomment --SpeedUp(59)
--fix finded error and test version on few accaunts. If you find any error in waypoint please PM me.
--For enable same waypoint function need Rock5's Mail Mods userfunction http://www.solarstrike.net/phpBB3/viewt ... =27&t=1561

Read new available option inside waypoint.



_Sorry for my bad English.

Re: course of terror WP

Posted: Sat May 11, 2013 5:50 am
by rock5
Finally updated the first post version of cot_tele. Now version 1.82.

Just a few bug fixes from 1.81 and now compatible with MicroMacro 1.03.

Re: course of terror WP

Posted: Sat Jun 08, 2013 9:42 am
by CanceR
hello everyone,
did you found a way how to log data from new "Currency list" after Chapter 6 patch?
thanks in advance

Re: course of terror WP

Posted: Sat Jun 08, 2013 10:12 am
by rock5
I posted a function in this topic.
http://www.solarstrike.net/phpBB3/viewt ... 196#p50196

I'm going to commit it now.