Page 44 of 46

Re: rock5's "fastLogin Revisited"

Posted: Sun Nov 30, 2014 8:36 pm
by Bot_romka
Automatic Character Create!

instal: закиньте файл в папку interface\loginxml\

Code: Select all

fastAutoCharacterCreate = true;	-- set to false or true
fastLoginCharCreateWaitTime = 0.5;

local time_remaining = fastLoginCharCreateWaitTime;
function CharacterSelect_OnUpdate(this, elapsedTime)
	if ( CHARACTER_SELECT_ROTATION_START_X ) then
		local x = GetCursorPos();
		local diff = (x - CHARACTER_SELECT_ROTATION_START_X) * CHARACTER_ROTATION_CONSTANT;
		CHARACTER_SELECT_ROTATION_START_X = x;
		SetCharacterSelectFacing(GetCharacterSelectFacing() - diff);
	end


	if (fastLoginAutoEnter and ( not fastLoginLoggedIn )) or (fastLoginLoggedIn and DoRelog) then -- rv edited
		if fastLoginRegSel then
			CHARACTERSELECT_REGION_SELECTED = fastLoginRegSel;
		end
		CharacterSelect_EnterWorld();
	end

	if (fastAutoCharacterCreate) then
		time_remaining = time_remaining - elapsedTime;
		if (time_remaining > 0) then
			return
		end
		time_remaining = fastLoginCharCreateWaitTime;
		local fastLoginNumChars = GetNumCharacters();
		if ( fastLoginNumChars < MAX_CHARACTERS_DISPLAYED ) then
			CharacterSelect_SelectCharacter(CharacterSelectCreateButton:GetID())
			CharacterCreate_Default()
			CharacterCreate_Okay()
			CharacterList_Update()
		end  
	end
end
Need help with a bug create extra characters after re-entering the account.

All file were not working and removed.

Re: rock5's "fastLogin Revisited"

Posted: Sun Nov 30, 2014 10:41 pm
by rock5
Note: This wont be compatible with future versions of my fastlogin (loginxml). And, if I ever get around to finishing my new version, it will have an auto generate characters option. But it could be a while so this file could be useful until then.

Re: rock5's "fastLogin Revisited"

Posted: Mon Dec 01, 2014 4:18 pm
by Bot_romka
I tested many variant and I'm sure full automatic char create without bugs will not be able to create. I added function for manual start auto create character (Shift-Click on "Create" button) and unlock all 10 chars for select and create.

The second archive interface_Login_texture for those who want to redraw the frame character selection.

Re: rock5's "fastLogin Revisited"

Posted: Sat Jan 03, 2015 10:27 am
by Desmond
Interesting I just realized, I do run one account addon creates characters but when run a second account it doesn't make it bad, but when I close the game and run the following account addon creates..

Re: rock5's "fastLogin Revisited"

Posted: Tue Jan 06, 2015 7:37 am
by Desmond
How to bind the button to automatically add-click "Delete"?
for example

Code: Select all

DeleteCharacter(())

Re: rock5's "fastLogin Revisited"

Posted: Mon Mar 02, 2015 4:57 am
by Bot_romka
Fixed and modified version of loginxml v3.71b1

fix: not working baseScript() and fastLoginAutoEnter
add: skip dialog character recover, fastLoginCharacterSelectDelete, fastLoginCharacterSelectRecover, CustomStartAutoGenerateCharacters, many Tooltip, new user options and even something...


p.s. function AutoGenerateCharacters not work properly...

Re: rock5's "fastLogin Revisited"

Posted: Mon Mar 02, 2015 5:37 am
by Bot_romka
For Desmond
How to bind the button to automatically add-click "Delete"?
Можешь использовать loginScript("CharacterSelect_Delete()") для удаления персонажей, не обязательно кликать мышкой. Просто в онлоад добавь эту функцию с её переменными из новой версии userfunction_login.lua Я щас разрабатываю как использовать авто-удаление в аддоне автологине но из-за жуткого бага с определением что окно персонажей загрузилось не могу это использовать. Вот моя версия http://www.solarstrike.net/phpBB3/viewt ... 903#p60903 для аддона автологина что выложил в паблик выше.

Re: rock5's "fastLogin Revisited"

Posted: Wed Jun 03, 2015 3:35 am
by Testa
Idea for a new function to print the actually state of relogging:

Charlist:

Code: Select all

SetCharList({{
      {account=1 , chars= {1}},
      {account=2 , chars= {1}},
   },{
      {account=3 , chars= {1}},
      {account=4 , chars= {1}},
      {account=5 , chars= {1}},
      {account=6 , chars= {1}},
   }})
Active Account | Output (print):

Code: Select all

acc 1 | Account 1 of 2
acc 2 | Account 2 of 2

acc 3 | Account 1 of 4
acc 4 | Account 2 of 4
acc 5 | Account 3 of 4
acc 6 | Account 4 of 4
with an option to modify:
Active Account | Output (print):

Code: Select all

acc 1 | Account 1 of 2 (1 left)
acc 2 | Account 2 of 2 (0 left)

acc 3 | Account 1 of 4 (3 left)
acc 4 | Account 2 of 4 (2 left)
acc 5 | Account 3 of 4 (1 left)
acc 6 | Account 4 of 4 (0 left)

Re: rock5's "fastLogin Revisited"

Posted: Thu Jun 04, 2015 11:19 am
by rock5
The output looks a bit confusing. Are you saying that every time it changes character you want it to print out the whole list of characters and where you are up to? Or are you saying you want it to just print 3 of 4 etc?

One thing you have to realize, there is no way for the userfunction (or even loginxml) to know how many characters there are in all the listed accounts. So at this point, I don't even think we could add how many are left, except of course for the current account. Of course you could do it if you specify a full character list with setCharList, but if you use chars={}, which means 'all characters in the account', then there would be no way to know the numbers.

Re: rock5's "fastLogin Revisited"

Posted: Fri Jun 05, 2015 2:18 am
by Testa
First of all thx for the fast reply and your help
rock5 wrote:The output looks a bit confusing. Are you saying that every time it changes character you want it to print out the whole list of characters and where you are up to? Or are you saying you want it to just print 3 of 4 etc?
The second :D I only want to print out: "Account 1 of 2 (1 left)" etc
rock5 wrote: One thing you have to realize, there is no way for the userfunction (or even loginxml) to know how many characters there are in all the listed accounts. So at this point, I don't even think we could add how many are left, except of course for the current account. Of course you could do it if you specify a full character list with setCharList, but if you use chars={}, which means 'all characters in the account', then there would be no way to know the numbers.
I mean accounts (not chars) ...
If account 1 has 3 chars then the output of all 3 chars would be for example: Account 1 of 2 (1 left)

Code: Select all

account 1, char1 -> Print: Account 1 of 2 (1 left)
account 1, char2 -> Print: Account 1 of 2 (1 left)
account 2, char1 -> Print: Account 2 of 2 (0 left)
account 2, char2 -> Print: Account 2 of 2 (0 left)
account 2, char3 -> Print: Account 2 of 2 (0 left)

Re: rock5's "fastLogin Revisited"

Posted: Sat Jun 06, 2015 2:07 am
by rock5
I see what you mean now. It just gets a bit confusing especially when you add the existing printout. When you print both I think it will look confusing. How about modifying the existing print out to look something like this.

Code: Select all

Changing to character 2 account 3 (2/4)
(2/4) meaning '2 of 4'. I think that's clear.

We could also have how many characters on the account left too. Eg.

Code: Select all

Changing to character 2 (2/7) account 3 (2/4)
How does that sound?

Re: rock5's "fastLogin Revisited"

Posted: Sat Jun 06, 2015 3:05 am
by Testa
this is exactly what i mean :)


Maybe a second idea: would it be possible to print out the runtime of the script?
for example: charlist has 3 accounts... after finished the last acc (char) it would print out the runtime. it tryed to make it by myself but i get it only to print nonsence
Printout:

Code: Select all

Last player finished. Runtime: 2:15 hours
and/ or

Code: Select all

Changing to character 2 (2/7) account 3 (2/4). Runtime: 1:10 hours
[/i]

Re: rock5's "fastLogin Revisited"

Posted: Sat Jun 06, 2015 4:09 am
by rock5
I think that could be done. Of course the time wont make much sense if you had to restart a waypoint file or if you paused it for a time.

All we would have to do is record the time when it loads a new character and then display the difference when we load the next one. For the first character, that wont have a start time, we can just record the time as soon as the userfunction is loaded which is as soon as you start the bot.

To display the time you need to format it with something like os.date. This would work

Code: Select all

print(os.date("%H%M%S",os.time()-startTime))
This would print something like 02:15:32 for 2 hours, 15 minutes and 32 seconds.

Re: rock5's "fastLogin Revisited"

Posted: Sat Jun 06, 2015 4:25 am
by Testa
this sounds great

i tryed it with

Code: Select all

printf("\nWe where running for %s seconds.\n", math.floor (os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time ));
but it displays nonsence by using the relog function (if i use it with a single waypoint and one char it works). maybe because i have 2 waypoint in a loop and 6 accounts.

Re: rock5's "fastLogin Revisited"

Posted: Sat Jun 06, 2015 7:20 am
by rock5
I can't guess what you mean by 'nonsense'. I suppose it would depend on when and where BotStartTime_nr and Sleeping_time are updated. Probably, also, if you do a loadProfile it will reset those values. Hm... that's probably what you want. Are you doing a loadProfile() after changing character?

Re: rock5's "fastLogin Revisited"

Posted: Sat Jun 06, 2015 7:39 am
by Testa
nonsense = wrong values, like -2357675,2322 seconds
rock5 wrote:Are you doing a loadProfile() after changing character?
yes

my relog function is like this:

Code: Select all

function relog()
   
      SetCharList({
         {account=1, chars= {1}},
         {account=2, chars= {1}},
         {account=3, chars= {1}},
         {account=4, chars= {1}},
         {account=5, chars= {1}},
         {account=6, chars= {1}},
      })

      LoginNextChar()
      yrest(4000)
      player:update()
      loadProfile()
      loadPaths("path2.xml");
   end
i try it tomorrow without the loadProfile()

thx again and sorry about the bad english :)

Re: rock5's "fastLogin Revisited"

Posted: Sun Jun 07, 2015 1:54 am
by Testa
now it works! big thx!

but i can´t get it in a format like this
rock5 wrote:02:15:32 for 2 hours, 15 minutes and 32 seconds.
my code i try to format
Testa wrote:printf("\nRuntime: %s.\n", math.floor (os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time ));

Re: rock5's "fastLogin Revisited"

Posted: Sun Jun 07, 2015 9:59 am
by rock5
Looks like it doesn't work after all.

I found another way that might work.

Code: Select all

print(os.date("!%X",os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time))
I'm not sure what "!%X" is supposed to mean but it seems to work.

Re: rock5's "fastLogin Revisited"

Posted: Mon Jun 08, 2015 9:34 am
by Testa
tested it with your code
rock5 wrote:print(os.date("!%X",os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time))
but the code return wrong values (outputs)

the code returns

Code: Select all

!01:00:08
but should return like (i don´t clock the exact time but it is just after the script started)

Code: Select all

!00:00:08

Re: rock5's "fastLogin Revisited"

Posted: Tue Jun 09, 2015 3:58 pm
by rock5
I think the problems with the hours is because of time zones. The ! is supposed to fix that. Seeing as it adds 1 hour maybe it is a daylight hours issue?

At this point I would just give up using os.date and do it manually by calculating the separate values and formatting it.

Code: Select all

local s = os.difftime(os.time(),player.BotStartTime_nr) - player.Sleeping_time
printf("%.2d:%.2d:%.2d", s/(60*60), s/60%60, s%60)