• 0

Need some help with a script.


Question

Hey guys, on my site DominateDominion.com I am trying to have a table that updates every day. Basically, I play a game called League of Legends and they have a map called Dominion. There is no ranked mode for dominion, but I was given some files that can get the players elo. I have a note pad where I type in the person's usernamer whos elo I want to find out, then I run a batch file, and open results.txt and it gives the players elo. The guy who gave me the files said all I need for it to update on my site automatically each day was a script where it dumps all the users from the site to a file, runs the batch file, then sends the update back to the server. So how could I do this? I'm don't know any programming or anything at all. Where should I start looking?

Link to comment
https://www.neowin.net/forum/topic/1057344-need-some-help-with-a-script/
Share on other sites

Recommended Posts

  • 0

To have a script executed once per day you need a scheduled task / cronjob.

If programming is needed, then you'll need to post a copy of the code this person has given to you, along with any relevant code from your website and hope someone here has some free time to help you integrate it.

Your site appears to be running wordpress, so thats a good start, we know you've got PHP available.

  • 0

To have a script executed once per day you need a scheduled task / cronjob.

If programming is needed, then you'll need to post a copy of the code this person has given to you, along with any relevant code from your website and hope someone here has some free time to help you integrate it.

Your site appears to be running wordpress, so thats a good start, we know you've got PHP available.

I can do it manually as well. But it's not a script he gave me. Or maybe it is. He sent me like 4 files.

  • 0

Can you post the files in a zip file on here? Or are they sensitive...

Well he told me he doesn't want me sharing them around a lot. But he knows i'm trying to get it on my site which he is fine with. Sooo... :\

BTW, i'm willing to pay someone if they want to do this for me.

  • 0

Ok, just so the whole community can help out: the OP has a Windows executable, called by a batch script with a couple of arguments, that returns the results of the query into results.txt.

If you have a Windows server for your webhosting, as theblazingangel said, you can set the batch script up on a scheduled task. From there it's easy to write a PHP file that pulls the results from the text file to display it on your site.

....but I guess the main question is, do you use a Windows server for your hosting?

  • 0

Ok, just so the whole community can help out: the OP has a Windows executable, called by a batch script with a couple of arguments, that returns the results of the query into results.txt.

If you have a Windows server for your webhosting, as theblazingangel said, you can set the batch script up on a scheduled task. From there it's easy to write a PHP file that pulls the results from the text file to display it on your site.

....but I guess the main question is, do you use a Windows server for your hosting?

Errrmmm. I don't know honestly. I use bluehost.com to host my site.

  • 0

Errrmmm. I don't know honestly. I use bluehost.com to host my site.

Create a file called whatever.php containing this:

<?php echo $_SERVER['SERVER_SOFTWARE']; ?>

Upload it to your server, go to dominatedominion.com/whatever.php, copy the output and post it here.

  • 0

You could modify the batch script (.bat file) to upload results.txt to your server upon completion, and then setup the scheduled task on your own PC... as for how, maybe someone else can help. My command line knowledge only really extends as far as Linux.

  • 0

The easiest solution i cna think of is uploading results.txt to drop box then getting your site to read the results, i believe there is two ways to do this.

1. edit th bat file to copy the results to your dropbox folder (hell maybe the exe will run from the dropbox folder i dont know check!) then schedule the file to run

2. have 2 bat files one runs the bat file the second uploads to your dropbox

Of cause your computer needs to be on at the time of the schedule

Someone here was uploading a folder with a bat file.

http://forums.dropbox.com/topic.php?id=18137

  • 0

Just saying that would be the easiest solution as of now, if it is uploaded by schedule then the text file is included its doneas for commandline:

To add new scheduled task:

  • Go to Windows Start Menu > Control Panel > System and Security > Administrative Tools > Schedule Tasks.
  • In the Task Scheduler menu go to Action > Create Basic Task.
  • Give your task a name and click Next.
  • Choose when the task should be run and click Next.
  • For task action, select Start a program and client Next.
  • Browse for WinSCP.exe executable.
  • In Add arguments add appropriate WinSCP command-line parameters to execute the scripting commands you need (typically you will use /script or /command parameters).
    The resulting arguments may look like:
    /command ?option batch abort? ?option confirm off? ?open user:[email protected]? ?put d:\examplefile.txt /home/user/? ?exit?
    Note that the command-line parameter /console was not specified, what makes WinSCP.exe not show the console window, not to disturb you while you are using your workstation.
  • You may want to use /log parameter to turn on session logging to file.
  • When done, click Next, review your options and confirm with Finish.
    source: http://winscp.net/eng/docs/guide_schedule
    O
    f cause it may be different with a host

  • 0

Alright guys, I talked to the person who gave me the files but i'm a bit confused as to what he is saying. He seems to think this should work though? (I'm thefeedski, he is jabe).

TheFeedski (4:10): Alright, so you know how you told me I just have to get someone to make a script that does whatever

I have ti saved, 1 sec

Ok you said "script where it dumps all the users from the site to a file, runs the batch file, then sends the update back to the server."

Jabe (4:11): yes

TheFeedski (4:11): Ok, so they told me that's easy enough to do if my hosting runs windows.

But they use linux.

So...

Someone said

"you can get the [uncompiled] source code of the .exe file from the guy who gave you the files (doubtful). "

Jabe (4:11): Do you have a database?

TheFeedski (4:12): if you*

Do I have a database?

Jabe (4:12): Yes

TheFeedski (4:12): Uhhh. Maybe? lol

I don't know. :p

Jabe (4:12): Or how are you planning on showing these ranks?

TheFeedski (4:12): I was just wanting them in a table

like highest to lowest.

Jabe (4:12): I assumed you'd have a database of users that people could look at a page and the table would be automatically generated

TheFeedski (4:13): I mean, I have a forum with everyones name.

I mean, they put their LoL account when registering.

Jabe (4:14): What forum software?

TheFeedski (4:14): phpbb

Jabe (4:14): You probably have a database then

TheFeedski (4:15): ah, ok.

Jabe (4:15): So script does...

"select lol_acct from users", dump list to file, execute program, update ratings in DB

Needs an extra column to store ratings first

Then someone can make a page that generates a table of all users

No need to copy files, just update DB

*update and query

He said I have to make sure I have a database first though.

  • 0

Ok, at the end of your batch script (open it in Notepad), paste this:

ftp -i -n -s:"%~f0"
open dominatedominion.com
user USERNAMEHERE
PASSWORDHERE
cd public_html
literal pasv
binary
put results.txt
disconnect
bye

Then tell us if it's successfully uploaded to http://www.dominated...com/results.txt

If so, we can help you get it from that, to displayed in a table on your website, and then tell you how to automate it. :)

  • 0

Ok, at the end of your batch script (open it in Notepad), paste this:

ftp -i -n -s:"%~f0"
open dominatedominion.com
user USERNAMEHERE
PASSWORDHERE
cd public_html
literal pasv
binary
put results.txt
disconnect
bye

Then tell us if it's successfully uploaded to http://www.dominated...com/results.txt

If so, we can help you get it from that, to displayed in a table on your website, and then tell you how to automate it. :)

Ok, just so I don't mess anything up. You want me to add that to the end of the batch file then upload JUST the batch file to my hosting? Or do I add that to the batch file and then upload just results.txt?

  • 0

You just add that to the end of the batch file then run it, if all succeeds it should hopefully upload results.txt onto the server then you just set up a schedule on your computer to automate it.

Btw im curious whats in this text file lol

Ahhh, so the username and password are for my hosting? Not my game user name and password?

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • I literally tried to install it on my PC today and it crashed upon every start up. I tried all the tricks, terminate and remove cache, uninstall, reinstall, reboot, install via winget.. in the end I had my call with Brad Wardell on Google Meet. Oh I also tried Teams on the web, and got no video or audio (yes I allowed mic and camera).
    • Microsoft explains how it made Teams so much faster in 2026 by Usama Jawad Microsoft Teams is Redmond's flagship online communication and collaboration tool, primarily used in enterprise, government, and school environments. It regularly receives updates, with Microsoft frequently revealing features currently in development as well, such as Efficiency Mode and a dedicated app for meeting recaps. Now, the company has shed some light on the backend enhancements it has made to its popular software in 2026. During the first half of 2026, switching between chats has become 20% faster on desktop and web, which is especially great for less powerful devices or hardware on weak networks. Microsoft explains that it tracks two types of chat switches. The first is a warm switch, which relates to returning to a recent chat, in which case it is most likely already present in memory and should load extremely fast. The other is a cold switch where a chat that hasn't been opened recently is now opened. Naturally, the second type of chat switch was causing the most notable latency spikes. Microsoft realized that this was happening because of three reasons. First, the query to fetch conversation data was being fired too late. Next, queries were being sent sequentially, increasing the overall round-trip time. Finally, there was no handling of response priority, which meant that non-critical responses would sometimes block the main thread. Microsoft solved all of these problems by firing the data query immediately, bundling queries to be sent together so that they wouldn't create a "waterfall" effect, and enabling faster painting of the frame. As a result, warm and cold switches now have almost the same latency, and the only distinguishable difference between them is due to the data layer response time. Next, Microsoft focused on reducing app hangs and freezes on macOS and iOS by 35%. On macOS, the company has a health monitor thread running in the background that does exactly what it says on the tin. The tech firm built a dedicated StackDecoder tool to analyze health monitor's output at scale. Through this combination, it decided to move several error reporting and monitoring threads either to the background or treated them as an asynchronous call so that they wouldn't block the main thread, causing Teams to freeze. On iOS, the same result was accomplished through optimization of computations, caching, offloading operations from the main thread, refactoring database access behaviors, deferring non-critical tasks, and more. On a related note, it also made people search 25% on iOS by optimizing the query pipeline, and efficient database task queuing and scheduling. However, Microsoft has emphasized that improving Teams' performance is an ongoing endeavor, and that it hopes that these efforts will continue to make the software a reliable partner in online communication scenarios. On a related note, Microsoft recently unveiled some upcoming performance upgrades for OneDrive on macOS too, and you can check those out here.
  • Recent Achievements

    • First Post
      StaticMatrix earned a badge
      First Post
    • Week One Done
      StaticMatrix earned a badge
      Week One Done
    • Rookie
      lamborghiniv10 went up a rank
      Rookie
    • One Month Later
      pinnclepd earned a badge
      One Month Later
    • First Post
      X-No-file earned a badge
      First Post
  • Popular Contributors

    1. 1
      +primortal
      520
    2. 2
      PsYcHoKiLLa
      210
    3. 3
      +Edouard
      147
    4. 4
      Steven P.
      96
    5. 5
      ATLien_0
      84
  • Tell a friend

    Love Neowin? Tell a friend!