Page 1 of 4

ElfDaily simplyfied

Posted: Sat Jul 14, 2012 10:38 am
by Jandrana
During my first days working with the RoM-Bot, I was browsing the forum and found a version of ElfDaily: http://www.solarstrike.net/phpBB3/viewt ... f=21&t=770

I learned a lot in the mean time and now this script looks quite complicated to me. So I rewrote it, to be a bit simpler and faster.

Checking the quest state at WP2 is done, because sometimes your char is nearer to WP2 and then the script starts at this WP2 and does not accept the quest. So the first run is wasted. I also like to avoid language dependent stuff as much as possible. So I'm putting quest names into variables. This way ppl using different client languages only need to change very few things.

Edit: moved code into attachment.

I also did a script to get a new Elf char ready doing the ElfDailies. It's "quick and dirty", but did the job for my purposes. In the end it loads the ElfDaily script and starts doing the daily quests at Blinsik.

Have fun!

Requires: Rock5's fastLogin and userfunction_LoginNextChar.

Re: ElfDaily simplyfied

Posted: Sat Jul 14, 2012 2:21 pm
by rock5
These days, if you want to make a script for multi language use and you can't substitute the id instead of the name, then you would use GetIdName(id) to get the local name for that id. eg.

Code: Select all

 questname1 = GetIdName(422340) -- Helping Them Grow

Re: ElfDaily simplyfied

Posted: Sun Jul 22, 2012 5:26 pm
by Ego95
Nice script, but your quests script is useless. You are right, it's a lvl4 daily, but you can accept it with lvl2, so you only have to walk to the daily quest manager and then do the 3 quests with "the basics of..."

But anyway thanks :)

Re: ElfDaily simplyfied

Posted: Wed Jul 25, 2012 11:36 am
by rage447
Is there a waypoint for the pre quest ? Doing pre quest with all my chars would be very exhausting.

Re: ElfDaily simplyfied

Posted: Thu Jul 26, 2012 7:04 am
by Jandrana
Is there a waypoint for the pre quest ?
Just read the initial posting completely!

Re: ElfDaily simplyfied

Posted: Fri Jul 27, 2012 12:05 am
by wilifox
Nice script, could you tell me where to enter the code to use "fastlogin"? I do not know how to do it to make me daily with all my characters. I read the post but i Fastlogin Rock I dont understand. Thx very much. Sorry for my English, translated from google translator. ;)

Re: ElfDaily simplyfied

Posted: Fri Jul 27, 2012 12:27 am
by lisa
http://www.solarstrike.net/phpBB3/viewt ... =27&t=1245

Loginxml[3.0].zip
save the loginxml folder from the zip file to
/Runes of Magic/Interface/
loginxml.png
Open accountlogin.lua and logindialog.lua and add in your account details.

Code: Select all

	Account1 = {	UserName = "accnamehere",	Password = "firstpasswordhere", Server = "servernamehere",	},

Code: Select all

	Account1 = {	ID = 1,		SecondaryPassword = "secondarypasswordhere",	},
loginfiles.png

Re: ElfDaily simplyfied

Posted: Fri Jul 27, 2012 4:46 am
by wilifox
Lisa thank you very much, doubt is that I have to write code in the file "ElfValley.xml" so I relog the characters. A greeting.

Code: Select all


<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
 <!-- # 1 --><waypoint x="31847" z="4592" tag ="Main">
    local dqCount, dqPerDay = RoMScript("Daily_count()");
    if dqPerDay > dqCount then 
       queststate = getQuestStatus(questName1);
       if queststate == "complete" then
...........
..........
.........
..........


where write the code, relog?
¿¿¿

Code: Select all


local function loadprofile()
      -- Re-initialize player
      player = CPlayer.new();
      settings.load();
      settings.loadProfile(convertProfileName(player.Name))
   end

Code: Select all

  SetCharList({
   {account=54 , chars= {1,2,3,4,5,6,7,8}},
   {account=55 , chars= {1,2,3,4,5,6,7,8}},
   {account=56 , chars= {1,2,3,4,5,6,7,8}},
   })
      LoginNextChar()
      loadprofile()
      loadPaths("ElfDaily");
    end

Sorry noobie question! where write the code, i dont know ;( Thx you

Re: ElfDaily simplyfied

Posted: Fri Jul 27, 2012 5:38 am
by lisa
Something like this will work.

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
<onLoad>
questEndNpcID1 = 112794
questName1 = "Helping Them Grow" 
function relog()
  SetCharList({
   {account=54 , chars= {}},
   {account=55 , chars= {}},
   {account=56 , chars= {}},
   })
      LoginNextChar()
      loadProfile()
      loadPaths("ElfDaily");
end
</onLoad>
 <!-- # 1 --><waypoint x="31847" z="4592" tag ="Main">
    local dqCount, dqPerDay = RoMScript("Daily_count()");
    if dqPerDay > dqCount then 
       queststate = getQuestStatus(questName1);
       if queststate == "complete" then
          player:target_NPC(questEndNpcID1);
          CompleteQuestByName(questName1);
         yrest(300);
         __WPL:setWaypointIndex(__WPL:findWaypointTag("Main")); 
        else
          player:target_NPC(questEndNpcID1);
          AcceptQuestByName(questName1,questEndNpcID1);
         yrest(300);
       end
    else
relog()
    end
    </waypoint>
   <!-- #  4 --><waypoint x="31847" z="4583" y="9">   
       queststate = getQuestStatus(questName1);
       if queststate == "not accepted" then
         __WPL:setWaypointIndex(1);
      end
   </waypoint>
   <!-- #  3 --><waypoint x="31860" z="4646" y="9">   </waypoint>
   <!-- #  2 --><waypoint x="31742" z="5070" y="-11">   </waypoint>
   <!-- #  1 --><waypoint x="31416" z="5715" y="-33" tag = "Item1">   
    queststate = getQuestStatus(questName1)
    if queststate == "incomplete" then
       player:target_Object(112976,300);
       yrest(2500);
       __WPL:setWaypointIndex(__WPL:findWaypointTag("Item1"));
   end
    </waypoint>
   <!-- #  1 --><waypoint x="31416" z="5715" y="-33">   </waypoint>
   <!-- #  2 --><waypoint x="31742" z="5070" y="-11">   </waypoint>
   <!-- #  3 --><waypoint x="31860" z="4646" y="9">   </waypoint>
   <!-- #  4 --><waypoint x="31847" z="4583" y="9">   </waypoint>
  
   
</waypoints>

Re: ElfDaily simplyfied

Posted: Fri Jul 27, 2012 5:55 am
by rock5
The code could be written different ways. Typically, because you finish your dailies after completing a quest, I usually start by completing the quest, then checking dailies, then accepting, so you don't have to repeat the waypoint to recheck the dailies. So something like;

Code: Select all

 <!-- # 1 --><waypoint x="31847" z="4592" tag ="Main">
       local queststate = getQuestStatus(questName1);
       if queststate == "complete" then
          player:target_NPC(questEndNpcID1);
          CompleteQuestByName(questName1);
          yrest(300);
       end

       local dqCount, dqPerDay = RoMScript("Daily_count()");
       if dqPerDay == dqCount then 
          relog()
       else
          player:target_NPC(questEndNpcID1);
          AcceptQuestByName(questName1,questEndNpcID1);
          yrest(300);
       end
    </waypoint>

Re: ElfDaily simplyfied

Posted: Sun Jul 29, 2012 3:38 am
by wilifox
Thx very much Lisa and Rock, now work!! Fastlogin increible!! Thx :P

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 6:51 am
by vo2male
Hello guys, i need some help.I followed the instructions above by lisa but i just cant figure out how to make this work. i read all the pages of
rock5's "fastLogin Revisited"
, tried and tried but kept on failing.

i wanted to include this code to my elven quest, "Helping them grow". i have 5 accounts with 8characters on each account. this is my code:

Code: Select all

<?xml version="1.0" encoding="utf-8"?><waypoints type="TRAVEL">
	
<onLoad>
questEndNpcID1 = 112794
questName1 = "Helping Them Grow" 
function relog()
  SetCharList({
   {account=1 , chars= {}},
   {account=2 , chars= {}},
   {account=3 , chars= {}},
   {account=4 , chars= {}},
   {account=5 , chars= {}},
   })
      LoginNextChar()
      loadProfile()
      loadPaths("Daily.xml");
end
</onLoad>
<!-- #  1 --><waypoint x="31847" z="4592" tag ='Main'>
			
			local dqCount, dqPerDay = RoMScript("Daily_count()");
			if 10 > dqCount then	
				queststate = getQuestStatus("Helping Them Grow");
				if queststate == "complete" then
					-- Complete quest
					player:target_NPC("Blinsik");
					sendMacro("CompleteQuest()"); yrest(2000);
					-- Accept quest
					player:target_NPC("Blinsik");
					sendMacro("AcceptQuest()"); yrest(2000);
					--__WPL:setWaypointIndex(__WPL:findWaypointTag("Main"));	
				else
					-- Accept quest
					player:target_NPC("Blinsik");
					sendMacro("AcceptQuest()"); yrest(2000);
				end
			else
				player:logout();
			end
	</waypoint>
	<!-- #  2 --><waypoint x="31812" z="4849">	</waypoint>
	<!-- #  3 --><waypoint x="31415" z="5720" tag = "Item">
			queststate = getQuestStatus("Helping Them Grow")
			if queststate == "incomplete" then
				player:target_NPC("Cleansing Crystal");
				yrest(3000);
				__WPL:setWaypointIndex(__WPL:findWaypointTag("Item"));
			end
	</waypoint>
	<!-- #  4 --><waypoint x="31878" z="4692">	</waypoint>
	<!-- #  5 --><waypoint x="31843" z="4593">	</waypoint>
</waypoints>
i am having this error:
Did not find any crashed game clients.
2:34pm - [string "..."]:5: attempt to call global 'SetCharList' (a nil value)

Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
Additional error i got:

Code: Select all

08/27/12 14:57:13  Auto-logging out.
Did not find any crashed game clients.
2:57pm - C:/micromacro/scripts/rom/functions.lua:594: bad argument #1 to 'memory
ReadBytePtr' ((null))


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
the second error is after i put the userfunction_LoginNextChar.lua inside the userfunction folder

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:00 am
by rock5
Have you installed the 'LoginNextChar' userfunction?
http://www.solarstrike.net/phpBB3/viewt ... innextchar

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:03 am
by vo2male
rock5 wrote:Have you installed the 'LoginNextChar' userfunction?
i've edited my first post.check it out. i dont know if i installed it correctly on the right directory..
i put it inside /rom/userfunctions folder

i have this error when i installed userfunction_LoginNextChar.lua

Code: Select all

08/27/12 14:57:13  Auto-logging out.
Did not find any crashed game clients.
2:57pm - C:/micromacro/scripts/rom/functions.lua:594: bad argument #1 to 'memory
ReadBytePtr' ((null))


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
maybe my waypoint is incorrect?

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:10 am
by rock5
There is no read memory on line 594 of functions.lua. What version of the bot are you running?

Edit: 'rom/userfunctions' is the right folder.

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:12 am
by vo2male
rock5 wrote:There is no read memory on line 594 of functions.lua. What version of the bot are you running?

i checked it out and it says RoM Bot Version 3.29, Revision 734


EDIT:
hmm something about the loading screen :roll:

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:28 am
by rock5
Nope, still no read memory. I'd say you have a corrupted installation. Try following these steps.
  • 1. Right click the "rom" folder and do an "SVN Update"
    2. Right click the "rom" folder and do a "TortoiseSVN/Revert"
    3. Right click the 'ingamefunctions' folder in the games 'interface/addons' folder and do an "SVN Update"
    4. Restart the game or type "/script ReloadUI()" in chat.
Then see if that works.

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:39 am
by vo2male
rock5 wrote:Nope, still no read memory. I'd say you have a corrupted installation. Try following these steps.
  • 1. Right click the "rom" folder and do an "SVN Update"
    2. Right click the "rom" folder and do a "TortoiseSVN/Revert"
    3. Right click the 'ingamefunctions' folder in the games 'interface/addons' folder and do an "SVN Update"
    4. Restart the game or type "/script ReloadUI()" in chat.
Then see if that works.

By doing this will it not matter what RoM client version im using? im playing on a ROM version 5.0.0.2559 btw


EDIT:
found this error after the update

Code: Select all

!! Notice: !!
The game may have been updated or altered.
 It is recommended that you run rom/update.lua

Did not find any crashed game clients.
3:43pm - Error while reading memory address for 'playerAddress'. Game seems to b
e changed!!! Please run 'rom/bot.lua update' AND install the new RoM Bot version
!


Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:48 am
by rock5
I don't think 734 would work with 5.0.0. I think you should be using 725.
  • 1. Right click the "rom" folder and select "TortoiseSVN/Update to revision..."
    2. Enter 725 and click ok.
    3. Right click the "rom" folder and do a "TortoiseSVN/Revert"
    4. Copy the 'ingamefunctions' folder from 'rom/devtools' to the games 'interface/addons' folder.
    5. Restart the game or type "/script ReloadUI()" in chat.

Re: ElfDaily simplyfied

Posted: Mon Aug 27, 2012 7:54 am
by vo2male
still with error :(

Code: Select all

Moving to waypoint #1, (31847, 4592)
08/27/12 15:51:42  Auto-logging out.
Did not find any crashed game clients.
3:52pm - C:/micromacro/scripts/rom/functions.lua:601: bad argument #1 to 'memory
ReadBytePtr' ((null))


Please enter the script name to run.
Type in 'exit' (without quotes) to exit.
Script>
well basically, what happen is. after it logs out, it will be directed to the log-on screen where you put in your username and password. but it doesn't automatically logs in.. i see my 5 accounts though on the 1 to 5 button.