Automatic 'login' script

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
ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#101 Post by ZZZZZ » Tue Mar 25, 2014 3:54 am

For some reason it is restarting client with the wrong link....only just having issues with it now, havn't changed a single thing in weeks O.o

Code: Select all

Changing to character 4 account 93 with client lnk "rom4ubot"
SUCCESS: The process with PID 7736 has been terminated.
Starting client rom4ubot ...
It should be starting with client rombot.

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

Re: Automatic 'login' script

#102 Post by rock5 » Tue Mar 25, 2014 10:15 am

Why would it start with that client? Were you using that client previously? Is that the default you set in the login userfunction?
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#103 Post by ZZZZZ » Tue Mar 25, 2014 10:53 am

Have been using it for weeks with no issues. And I was mostly botting on Nexon, which of course is down currently, so my default was set to rom4u client. For some reason my client loged into a US server kept trying to launch rom4ubot which it hadn't done before....was odd.

I changed the default to rombot after reading the 1st page again and so far its working fine...Just found it really odd that it did that all of a sudden.

Besides the above issue, I have also found that it'll 'click' before the client is actually the focus. Meaning it clicks what ever is behind where the client is supposed to be. It's also the same with character selection, if the bot tries to click character 2+ and the window wasnt the active one due to another trying to log in at the same time, it'll just click, then hit enter before it even selects the character, meaning the first character is logged rather than the specified 1.

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

Re: Automatic 'login' script

#104 Post by rock5 » Tue Mar 25, 2014 11:11 am

I found a bug. Line 190 of userfunction_LoginNextChar.lua

Code: Select all

	CurrentLoginServer = RoMScript ("GetCurrentRealm")
Should be

Code: Select all

	CurrentLoginServer = RoMScript ("GetCurrentRealm()")
That could be the cause.
  • 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: Automatic 'login' script

#105 Post by rock5 » Mon Mar 31, 2014 1:41 am

Updated userfunction_login.lua version 3.5
  • - Saves current server and character to help with recovering from crashes.
    - Added ServerLinkList.lua support
    - Added a few improvements to make starting multiple clients at once.
    - killClient now makes sure the client dies.
  • 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
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Automatic 'login' script

#106 Post by Ego95 » Mon Mar 31, 2014 2:12 pm

I am wondering if there would be a way, to let the bot "make the window size smaller" after starting/restarting a client. I don't mean minimize it, I am thinking of something like this:
Unbenannt.png
This improves the efficiency of the client/s and you can run much more. I am doing this manually a very long time, so it would be great, if the bot also could do this :)

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#107 Post by ZZZZZ » Mon Mar 31, 2014 3:20 pm

If you have a separate client, a 'botting' client like I do, 1 with all lowest settings and minimal addons, you can always edit the client.config file and set display to something small, then make it 'read-only'. That way it'll always start with those settings.

Code: Select all

[display]
windowed width=175
windowed height=114
That's what I have in mine.

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Automatic 'login' script

#108 Post by Ego95 » Mon Mar 31, 2014 4:47 pm

This is something I always wanted to do. But then I'd like to have the botting client completely without any addons. The problem is, that you would always need to change the SaveVariables.lua

But at first I will edit the client.config.ini file :)

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#109 Post by ZZZZZ » Mon Mar 31, 2014 5:12 pm

If you're worried about all your addon settings reseting there is a forum topic that has a solution on it, it's the same deal, using read-only.

~~ http://board.us.runesofmagic.gameforge. ... post629797

User avatar
Ego95
Posts: 564
Joined: Tue Feb 28, 2012 12:38 pm
Contact:

Re: Automatic 'login' script

#110 Post by Ego95 » Mon Mar 31, 2014 6:01 pm

Just got the same idea :D My SaveVariables is always on read-only to prevent interface crashes :) But it works finde for me :) Thank you

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

Re: Automatic 'login' script

#111 Post by rock5 » Mon Mar 31, 2014 10:15 pm

I also have savevariables.lua read only. I actually have 2 bat files set up to make it easier to protect and unprotect the files when I want to update the settings.

As to resizing the window via bot, you can.
  • setWindowPos(window HWND, x pos, y pos, width, height, always on top bool)

Eg.

Code: Select all

setWindowPos(__WIN, 0,0,200,50)
http://www.solarstrike.net/wiki/index.p ... wPos.28.29
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#112 Post by ZZZZZ » Wed Apr 02, 2014 10:27 am

Im still having some issues with selecting characters. When going to select a char it'll click and hit enter before the window is even pulled to the front meaning it'll miss clicking on char 2-8 and just enter on the first character. Is there any way to be 100% sure that the window its after is in focus (pulled to the top) before clicking and entering character?

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

Re: Automatic 'login' script

#113 Post by rock5 » Wed Apr 02, 2014 6:44 pm

Re-reading your earlier post I see the issue is with multiple clients restarting at the same time. The code that reserves the right to be active is not 100% foolproof. An idea was brought up to use directory creation as a more reliable way to do it but it was never implemented. I can look into doing that.
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#114 Post by ZZZZZ » Wed Apr 02, 2014 7:02 pm

Its also with just 1 client though, for example using google chrome when it goes to restart it'll end up clicking my pandora radio bookmark BEFORE pulling the RoM window to the front. Has done it a few times when commenting/replying to forum posts....really annoying, lol.

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

Re: Automatic 'login' script

#115 Post by rock5 » Wed Apr 02, 2014 7:45 pm

So your problem is it's just taking to long to open. That's going to be a problem because as far as I can see there is no command that gives us the active state of windows. So we have no way to wait until the window is open. You could just increase the rest. Try this, open userfunction_login.lua and do a search for "showWindow". There should be 2. After each one there should be a "rest(500)". Change that to a number big enough to give your client time to open. I'll make sure there isn't a command that can return the active window.
  • 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: Automatic 'login' script

#116 Post by rock5 » Thu May 01, 2014 6:13 am

I've added window resizing as part of login, both the client and console. I haven't uploaded it yet but let me know what you think. Here is a vid of me batch starting 4 clients.
http://youtu.be/CYmltyQW8MI

This is what I'm using as my batch file.

Code: Select all

@echo off
START ../../micromacro.exe "%~dp0/login.lua" acc:11 char:2 client:rom path:rbassist clientx:0 clienty:0   clientw:200 clienth:180 consolex:201 consoley:0   consoleh:180
START ../../micromacro.exe "%~dp0/login.lua" acc:12 char:2 client:rom path:rbassist clientx:0 clienty:181 clientw:200 clienth:180 consolex:201 consoley:181 consoleh:180
START ../../micromacro.exe "%~dp0/login.lua" acc:13 char:2 client:rom path:rbassist clientx:0 clienty:361 clientw:200 clienth:180 consolex:201 consoley:361 consoleh:180
START ../../micromacro.exe "%~dp0/login.lua" acc:14 char:2 client:rom path:rbassist clientx:0 clienty:541 clientw:200 clienth:180 consolex:201 consoley:541 consoleh:180
Yes, they are very long lines.

Let me know what you think.
  • 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

noobbotter
Posts: 527
Joined: Fri Aug 31, 2012 1:15 pm

Re: Automatic 'login' script

#117 Post by noobbotter » Thu May 01, 2014 7:13 am

That's pretty sweet. I think this is exactly what I need. Lots of times I play with two characters at once and I'm always having to resize and move the windows around to get them how I like them. I could create a similar batch file to start them with the windows exactly where I want them. Nice job.

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

Re: Automatic 'login' script

#118 Post by rock5 » Fri May 02, 2014 1:14 am

Ok here is version 4.0 beta 1.
userfunction_login.lua
(12.21 KiB) Downloaded 203 times
login.lua
(2.2 KiB) Downloaded 179 times
Changes:
  • - IMPORTANT: I had Administrator add a function to MM that I needed. So this version of login requires you to update MM to the latest stable version 1.04.167. http://www.solarstrike.net/micromacro
    - Fixed login failure. Changed the character selection memory address.
    - Added console and client resizing options.
    • login function:

      Code: Select all

      	login(character, account, client, clientx, clienty, clientw, clienth, consolex, consoley, consolew, consoleh)
      From prompt:

      Code: Select all

      	rom/login acc:48 char:2 client:rom4u path:cot_tele clientx:0 clienty:0 clientw:200 clienth:180 consolex:201 consoley:0 consoleh:180
      From batchfile:

      Code: Select all

      	START ../../micromacro.exe "%~dp0/login.lua" acc:48 char:2 client:rom4u path:cot_tele clientx:0 clienty:0 clientw:200 clienth:180 consolex:201 consoley:0 consoleh:180
    All position and sizing arguments are optional.
    - Changed the active window locking mechanism. Now instead of just writing to a file, it also creates a folder called 'lock'. The file it writes has changed to 'lock.pid'. You can delete the 'micromacro/micromacro.pid' file if you want to tidy up your folder. Thanks goes to dx876234 for the idea.
  • 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

ZZZZZ
Posts: 513
Joined: Sun Oct 21, 2012 1:42 am

Re: Automatic 'login' script

#119 Post by ZZZZZ » Fri May 02, 2014 3:01 am

Wooo! That fixed my issues with clicking before the window was pulled to the front. Thanks R5 :D :D

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

Re: Automatic 'login' script

#120 Post by rock5 » Fri May 02, 2014 3:21 am

That's good to know. :)
  • 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: Semrush [Bot] and 5 guests