It is currently April 27th, 2024, 8:10 am

Helping hand needed in case of RM code

Get help with creating, editing & fixing problems with skins
4nt1p0p
Posts: 8
Joined: October 9th, 2011, 9:54 am

Helping hand needed in case of RM code

Post by 4nt1p0p »

Howdy! :great:
I have some ideas about skins which are giving me headaches to solve them through code.
Maybe some of you find some time to help me with them :welcome:

1) I would like to create a RM skin which would be able to run windows shortcut, and at the same time include some information to it. For example if it would be some game shortcut, what I would like RM to do is take RM variable IP adress of server and put following line after the path the shortcut is running:

Code: Select all

 +connect *IP*
So in the basic meaning, the shortcut could be in fact a batch file, which would be executed from the button for example. But is it possible to run batch files from RM, and at the same time make parts of the batch files text variable? Again, f.e. I would create a batch file which would include:

Code: Select all

C:\Games\MyGame\blabla.exe +connect IP
And I would like to make that IP variable, so user can write IP adress of server he wants to run in the variables section of the code.

2) So basically the skin would be server metering, which would include information about server status (map playing, number of players, avarage connection etc.). Another issue I have is that I have only this version of the server stats available to me to read from: http://www.dark-alchemy.com/modules.php?name=a1_players
And I know that WebParser can read information which is included in some tags on the web. But since I am not a good developer I thought that someone beautiful would show me which kind of tags should I pick and how to put them into the code. Also, can it read that kind of information, or just XML versions?

Thank you very much for any answer in advance! :great:
BTW. Merry Christmas RM community :circle:
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Helping hand needed in case of RM code

Post by Kaelri »

For your first question, you can use a combination of variables and mouse actions. First, define your "IP" variable. For example:

Code: Select all

[Variables]
IP=123.456.789.0
Then, you can apply a mouse action to the meter that you want to launch the game. Refer to the "IP" variable by writing the variable name between two # signs:

Code: Select all

LeftMouseUpAction=["C:\Games\MyGame\blabla.exe" +connect #IP#]
For your second question, I'll refer you to the WebParser tutorial in the documentation as a starting point. The tutorial uses an RSS feed as an example, but getting information from your server status page is basically the same process. For example, this pattern would identify the current and total number of players:

Code: Select all

RegExp=(?siU)Players: (\d+)/(\d+)<br>
4nt1p0p
Posts: 8
Joined: October 9th, 2011, 9:54 am

Re: Helping hand needed in case of RM code

Post by 4nt1p0p »

Thank you very much! :bow:

I have one more question. Does Web Parser allow me to also take picture of the current map played and show it in the skin, or I have to create a folder with all the pictures inside?
User avatar
Kaelri
Developer
Posts: 1721
Joined: July 25th, 2009, 4:47 am

Re: Helping hand needed in case of RM code

Post by Kaelri »

I don't see a specific link to the level map on that page. If there is only a small number of maps, I would say that you might as well just include all of them in your skin's @Resources folder, since it will reduce your skin's bandwidth usage in exchange for only a little extra storage size.
4nt1p0p
Posts: 8
Joined: October 9th, 2011, 9:54 am

Re: Helping hand needed in case of RM code

Post by 4nt1p0p »

The community uses this wiki database with huge amount of maps that are played there http://www.dark-alchemy.com/wiki/index.php/Maps_Repository_/_Guides
So the total size of the skin would eventually get more than 2 times bigger I think. On the webparser page I have read that it returns information through String index. Does that mean that it cant return as an image?