• 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

    • Got it. Seem like a good improvement. Thanks. But, before we "Add the source to Trusted Sites," how would know if it is trusted or not? Could get messy for not first Knowing" it is clean. See what I mean?
    • AB Download Manager 1.9.0 by Razvan Serea AB Download Manager is an open-source, feature-rich download manager designed to accelerate downloads, organize files efficiently, and provide seamless control over downloads. With support for multiple connections, resume capability, and an intuitive interface, it enhances the downloading experience for users seeking speed and reliability. The software integrates with various browsers, enabling quick link grabbing and batch downloading. It supports HTTP, HTTPS, and FTP protocols, ensuring broad compatibility with different file sources. Users can schedule downloads, set speed limits, and categorize files automatically for better organization. AB Download Manager is lightweight yet powerful, making it a great alternative to proprietary download managers. Its open-source nature allows developers to contribute, customize, and improve the software as needed. Whether you're downloading large files, managing multiple downloads at once, or seeking an ad-free experience, this tool offers a practical and efficient solution. Key features of AB Download Manager: Multi-Connection Support – Accelerates downloads by splitting files into multiple segments. Resume Capability – Allows paused or interrupted downloads to be resumed without starting over. Batch Downloading – Supports downloading multiple files at once for improved efficiency. Browser Integration – Captures download links directly from browsers for seamless operation. HTTP, HTTPS, and FTP Support – Ensures compatibility with a wide range of file sources. Download Scheduling – Enables users to automate downloads at specific times. Speed Limiting – Lets users control bandwidth usage for optimized performance. File Categorization – Automatically organizes downloaded files into designated folders. User-Friendly Interface – Simple and intuitive design for easy navigation. Cross-Platform Compatibility – Works on multiple operating systems. Ad-Free Experience – No intrusive ads or tracking for a clean user experience. AB Download Manager 1.9.0 changelog: Added Czech language support User-friendly error messages for download errors (#1252) An option to remember the last selected queue and quickly add downloads to it by long-clicking the Add button ( #1246) An option to export/import downloads using JSON format A Download button on the multi-download page for cases where users do not want to start downloads without queue processing (#1247) The app now includes a logger that can be enabled using a command-line flag (#1226) Startup errors are now logged automatically to help diagnose initialization issues Changed The default unqueued "Max Concurrent Downloads" value has been changed from "Unlimited" to 3 (This can be customized in the app settings) Improved Updated translations Added an indicator on the Android main page when resume is not supported (#1248) Extract the file name from the download link as a fallback when no response information is available (#1209) Minor UI/UX improvements Download: AB Download Manager 1.9.0 | Portable | ~80.0 MB (Open Source) Download: ARM64 | Portable ARM64 | Android Links: AB Download Manager Website | Github Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I just started using Teams (and “New” Oiutlook) at work (instead of Slack) and both are truly abysmal pieces of software.
  • Recent Achievements

    • First Post
      DragonOfMercy earned a badge
      First Post
    • First Post
      bella52 earned a badge
      First Post
    • Reacting Well
      Techinmay earned a badge
      Reacting Well
    • Collaborator
      WndSks went up a rank
      Collaborator
    • One Month Later
      Sopa flores earned a badge
      One Month Later
  • Popular Contributors

    1. 1
      +primortal
      493
    2. 2
      PsYcHoKiLLa
      209
    3. 3
      +Edouard
      154
    4. 4
      Steven P.
      85
    5. 5
      FloatingFatMan
      72
  • Tell a friend

    Love Neowin? Tell a friend!