Jump to content

Search the Community

Showing results for tags 'dynamic'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • RuneLocus
    • News & Announcements
    • Information Booth
    • Website Support
    • Introductions
    • Chat
    • Forum Games
  • RuneScape Development
    • RSPS General
    • RuneScape Private Server (RS2)
    • RuneScape Private Server (503+)
    • RuneScape Private Server (EoC 742+)
  • Other
    • Digital Art
    • Gaming
    • Webdevelopment
    • Computers
  • Marketplace
    • RuneScape Market
    • RSPS Market
    • Others Market
    • Freelance Middleman Services
  • Super Secret Club's Topics

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Found 10 results

  1. Hey guys I was recently IP-banned for an unfair reason from Hydrascape, although my actual account is not banned because I have logged into it from a computer at a friends house. So I checked on my broadband page and I actually called my internet provider to make sure that I have a dynamic IP adress and they confirmed that not just do I have a dynamic IP but that my IP will change every night, so it makes sense that I should be unbanned from the server but I cannot log in. When I try using my VPN to login the game is stuck at 1% so they must have all of the VPN's IP's blacklisted. Is there any reason as to why my changing IP is still being recognized as me? Im very confused as to how they can know it is my computer trying to login. Any help?
  2. Well, I blame @[B][URL="http://www.runelocus.com/forums/member.php?u=63406"]high105[/URL][/B] for this lol. [B]Creating your own dynamic image of yours/others server's status[/B] To start off, you want to open a new file, be sure the file extension is saved as PHP (obviously) You want to first start off by adding [B]function [/B][COLOR=#00ffff]LoadPNG[/COLOR]: [spoiler=Requirements] A font preferably, I chose verdana. An offline / online image, again preferably in PNG, though you could choose your own, just be sure to change "imagecreatefrom[COLOR=#ff0000][B]png[/B][/COLOR]" to what ever image you have gone to. and "image[COLOR=#ff0000][B]png[/B][/COLOR]", "header('Content-Type: image/[COLOR=#ff0000][B]png[/B][/COLOR]');" [/spoiler] [spoiler=LoadPNG] [php] This is to call up an image for your status checker. function LoadPNG($imgname) { /* Attempt to open the image... */ $im = imagecreatefrompng($imgname); /* See if it failed */ if(!$im) { $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an error message */ imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc); } return $im; } [/php] [/spoiler] [spoiler=Defining IP and Port to read from] [php]define("IP", $_GET["IP"]); define("PORT", $_GET["PORT"]);[/php] [/spoiler] [spoiler=fsockopen] Now, you will need to find out the status of a server some how, so that's where fsockopen comes in! [php] $status = @fsockopen(IP, PORT, $errno, $errstr, 1); [/php] [/spoiler] [spoiler=Calling image + status of server response] [php] if ($status > 0){ header('Content-Type: image/png'); $img = LoadPNG('online.png');; $tc = imagecolorallocate($img, 178, 150, 150); // Font colour imagettftext($img, 12, 0, 30, 30, $tc, "verdana.ttf", IP); imagettftext($img, 8, 0, 60, 43, $tc, "verdana.ttf", "On the port: ".PORT); imagepng($img); imagedestroy($img); } else { header('Content-Type: image/png'); $img = LoadPNG('offline.png');; $tc = imagecolorallocate($img, 178, 150, 150);// Font colour imagettftext($img, 12, 0, 30, 30, $tc, "verdana.ttf", IP); imagettftext($img, 8, 0, 60, 43, $tc, "verdana.ttf", "On the port: ".PORT); imagepng($img); imagedestroy($img); } [/php] [/spoiler] [spoiler=Results] [php] function LoadPNG($imgname) { /* Attempt to open the image... */ $im = imagecreatefrompng($imgname); /* See if it failed */ if(!$im) { $im = imagecreatetruecolor(150, 30); $bgc = imagecolorallocate($im, 255, 255, 255); $tc = imagecolorallocate($im, 0, 0, 0); imagefilledrectangle($im, 0, 0, 150, 30, $bgc); /* Output an error message */ imagestring($im, 1, 5, 5, 'Error loading ' . $imgname, $tc); } return $im; } define("IP", $_GET["IP"]); define("PORT", $_GET["PORT"]); $status = @fsockopen(IP, PORT, $errno, $errstr, 1); if ($status > 0){ header('Content-Type: image/png'); $img = LoadPNG('online.png');; $tc = imagecolorallocate($img, 178, 150, 150); // Font colour imagettftext($img, 12, 0, 30, 30, $tc, "verdana.ttf", IP); imagettftext($img, 8, 0, 60, 43, $tc, "verdana.ttf", "On the port: ".PORT); imagepng($img); imagedestroy($img); } else { header('Content-Type: image/png'); $img = LoadPNG('offline.png');; $tc = imagecolorallocate($img, 178, 150, 150);// Font colour imagettftext($img, 12, 0, 30, 30, $tc, "verdana.ttf", IP); imagettftext($img, 8, 0, 60, 43, $tc, "verdana.ttf", "On the port: ".PORT); imagepng($img); imagedestroy($img); } [/php] [/spoiler] [spoiler=Rewriting page (optional)] Create a file named [B].htaccess[/B] Inside it, write: [code] Options +FollowSymlinks RewriteEngine on RewriteBase /status RewriteRule (.*):(.*)\.png$ [B]FILE_NAME_HERE[/B].php?IP=$1&PORT=$2[/code] Make sure that IP and PORT are the right ones as in the tutorial above, as you can obviously change them :) [/spoiler] [B]Going to the page: [/B][U]With .htaccess[/U] Simply enter in your website, IE: [URL]http://127.0.0.1/YOURIP:YOURPORT.png[/URL] [U]Without .htaccess[/U] Again, simply enter in your website, IE: [URL]http://127.0.0.1/[/URL][B]FILE_NAME_HERE.php?IP=YOURIP&PORT=YOURPORT[/B] Let me know if you run into any problems, Just wrote this off the top of my head, may be some errors I may not of foreseen o-o
  3. [I]This code was written for my rsps project so I thought it would be appropriate to post it here.[/I] I wrote this code earlier today to prevent the need to restart the server application every time I need to apply a file modification. The reason this could be useful for you is because you wont have to worry about character file rollbacks, etc... for something as stupid as adding an npc spawn to a configuration file. Please keep in mind that this is not a copy and paste tutorial it is a code snippet that (with modification) can be ported into your own applications. Requirements: Java 1.7 (not backwards compatible with other development kids) [I]Note: This code has been modified from its original version to be a standalone application by removing certain application specific pieces of code. The original code will be available through pm for those who are interested in the entire system.[/I] [CODE]/* * Copyright (c) 2014 -- Scott K. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. */ package org.iyaoyas.io.file; import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardWatchEventKinds; import java.nio.file.WatchEvent; import java.nio.file.WatchKey; import java.nio.file.WatchService; import java.util.Iterator; import java.util.List; /** * A {@link Service} responsible for listening for file modifications in the designated directories. * * [MENTION=52317]auth[/MENTION]or Scott K. */ public class FileWatcherService { /** * The entry point for the application. * * [MENTION=75098]Para[/MENTION]m args the command line arguments */ public static void main(String[] args) { FileWatcherService fws = new FileWatcherService("./data/"); fws.start(); } /** * The directory to watch for file modification. */ private final Path directory; /** * Whether or not the file watcher service is running. */ private boolean running = false; /** * Creates a new <code>FileWatcherService</code>. * [MENTION=75098]Para[/MENTION]m directory the directory */ public FileWatcherService(String directory) { this.directory = Paths.get(directory); } /** * Creates a new <code>FileWatcherService</code>. * [MENTION=75098]Para[/MENTION]m directory the directory * [MENTION=75098]Para[/MENTION]m subs the sub directories */ public FileWatcherService(String directory, String... subs) { this.directory = Paths.get(directory, subs); } public void start() { //create watch service try (WatchService watcher = directory.getFileSystem().newWatchService()) { directory.register(watcher, StandardWatchEventKinds.ENTRY_MODIFY); //listen for file modifications in the specified directories... System.out.println("File watcher service initialized..."); for (running = true; running;) { //block until a file modification has been made WatchKey key = watcher.take(); List<WatchEvent<?>> events = key.pollEvents(); for (Iterator<WatchEvent<?>> itr = events.iterator(); itr.hasNext();) { WatchEvent<?> event = itr.next(); String name = event.context().toString(); System.out.printf("%s:%s%n", name, event.kind().name()); //if the file in question has been loaded into memory we would //take the necessary steps to apply the update here //TODO ... } key.reset(); } System.err.println("Shutting down file watcher service..."); //TODO ... } catch (IOException | InterruptedException ex) { ex.printStackTrace(System.err); } } public void stop() { //TODO ... } /** * Returns the <code>running</code> flag. * [MENTION=75098]Para[/MENTION]m <tt>true</tt> file watcher service is running */ public boolean isRunning() { return running; } /** * Initializes the <code>FileServer</code> shutdown sequence. */ public void shutdown() { this.running = false; } }[/CODE] You can compile and run this code to test it out if you want. If you are confused about how to apply this to your own designs please pm me and I will elaborate further on this codes intended use and more specifics on how you can apply this to a server of your choice (PI, DeltaScape, Winterlove based servers, Shard Revolutions, Hyperion, Apollo, etc...). Thanks for reading and best of luck in your development! - IYAOYAS EDIT: Once again Cart RL's fucking mentioning system fucks my javadoc... EDIT2: Cart the name of the thread doesn't reflect the content at all!! wtf....
  4. I'm trying to sort through the logic behind creating a user-defined workflow, that is dynamic based on the user's decision/choices as well as the options that they pre-defined. Obviously since the user is inputting their own options, messages, and questions; it is not as easy as simply checking the conditions based on the questions, because I will not know what conditions exist on a specific question. So basically, I brainstormed and came up with this logic. Can anyone confirm if this logic is accurate or demonstrate a better method? Database Structure: Main Table: [LIST] [*]INT | id | AI [*]VAR_CHAR | title | NULL [*]INT | type | NULL [*]INT | stage | NULL [*]INT | points | NULL [/LIST] Type Table: [LIST] [*] (INT) id, VAR_CHAR (type) [*] 1 - Question [*] 2 - Option [*] 3 - Message [/LIST] So with this logic, every possible option of a workflow has been abstracted to a core value base: The id, which is the reference value to the database table. The title, the description of the option, the final output message, or the question being asked. The type, what type of entity we are dealing with The stage, specific step within the specific question loop The reference, which question/option the entity relates to The 'points', the next stage/option/entity So the flow would appear like this: [IMG]http://i.imgur.com/hJc2MyO.png[/IMG] Oh yeah, I forgot to mention this is for a service question step-through application. The questions are just bull-shit, I needed examples to play with. #5 & #9 are the same entity but a duplicate entry. Although this isn't what I want, it makes sense to point to a new entity base for different questions. The problem occurs after the point of the split though, because you could have duplicated logic for each entity, with staging. So it could be: 10 - Is it blue? 10->12 11 - Is it blue? 11->13 12 - Does it turn? 13 - Does it turn? And so on. So assistance where it can be advised. I appreciate feed back! -------------------------------------------------- EDIT: If I reference the entity not to the choice, but to the higher original reference point, I could completely avoid the conflict split. Although that means square one if the option has to go back. So that means: Question 1 - Option 1 Option 1 -> Question 2 - Option 2 Option 2 -> Question 3 Question 2: - Option 1 Option 1 -> Question 3 - Option 2 Option 2 -> Output Result 1 Question 3: - Option 1 Option 1 -> Question 4 - Option 2 Option 2 -> Output Result 2 So if you had to reverse your decision at any point after Question 1, it would go back to the first reference of the stage, which in this case is Question 1, since it links to the highest level. But, if there was a single choice that split after Question 1, the options below would link to that set point.
  5. I've been doing some Topcoder, and there's a bunch of dynamic programming problems in the competition. It takes forever for me to realize that I can write a recursive backtracking solution, but as soon as I can, I can write the algorithm pretty quickly. Problem is, by then, the programming phase is pretty much over. I can write the solution pretty quickly if someones tells me it's a dp problem. Do you guys have some kind of test that you do to see if it's dp?
  6. I know it's probably easy, but I've always wondered how to do it myself. I finally figured it out last night, and I'm quite proud that I achieved it. :) [IMG]http://rune-force.org/highscores/sig2.png?fname=charlie[/IMG] [IMG]http://rune-force.org/highscores/sig3.png?fname=charlie[/IMG]
  7. step one, make sure you have this in you class [CODE]public void StartGame() { p.setInfiniteStopDelay(); CoresManager.slowExecutor.execute(new Runnable() { @Override public void run() { try { boolean needDestroy = mapBaseCoords != null; final int[] oldMapBaseCoords = mapBaseCoords; mapBaseCoords = RegionBuilder.findEmptyMap(8, 8); [COLOR="#FF0000"]RegionBuilder.copyAllPlanesMap(0, 0, mapBaseCoords[0], mapBaseCoords[1], 8);[/COLOR] [COLOR="#FF0000"]PlacePlayerInGame();[/COLOR] if (needDestroy) { WorldTasksManager.schedule(new WorldTask() { @Override public void run() { CoresManager.slowExecutor .execute(new Runnable() { @Override public void run() { try { RegionBuilder .destroyMap( oldMapBaseCoords[0], oldMapBaseCoords[1], 8, 8); } catch (Exception e) { e.printStackTrace(); } catch (Error e) { e.printStackTrace(); } } }); } }); } } catch (Exception e) { e.printStackTrace(); } catch (Error e) { e.printStackTrace(); } } }); }[/CODE] [COLOR="#FF0000"]RegionBuilder.copyAllPlanesMap(0, 0, mapBaseCoords[0], mapBaseCoords[1], 8);[/COLOR] this will copy the selected region you want to be moved to an empty map, the (0, 0, will be the id's, regionID x and RegionID Y. [COLOR="#FF0000"]PlacePlayerInGame();[/COLOR], this is how your going to get your subject in the region that was created on the map. [CODE]private void PlacePlayerInGame() { p.resetStopDelay(); p.setNextWorldTile(new WorldTile(getBaseX() + 3, getBaseY() + 3, 0)); }[/CODE] You can start a controller if you have one, you can also play music.. etc Now lets find a region to move. [IMG]http://i49.tinypic.com/33nw7eh.png[/IMG] Im going to use Fight caves as an example, iv'e labled the x, and y in green. the top left corner is x, and the bottom right corner is y. [CODE][COLOR="#FF0000"]RegionBuilder.copyAllPlanesMap(0, 0, mapBaseCoords[0], mapBaseCoords[1], 8);[/COLOR][/CODE] we are going to insert the ids in there. the ids happen to be [COLOR="#FF0000"]296, 632[/COLOR] so we're going to put that in there. [CODE][COLOR="#FF0000"]RegionBuilder.copyAllPlanesMap(296, 632, mapBaseCoords[0], mapBaseCoords[1], 8);[/COLOR][/CODE] Now lets add a method for leaving the area. [CODE]public void DestroyRegion(final boolean logout, int mode) { WorldTile tile = new WorldTile(0, 0, 0); if (logout) p.setLocation(tile); else { p.getControlerManager().removeControlerWithoutCheck(); p.setInfiniteStopDelay(); p.setNextWorldTile(tile); NpcsToKill = 0; NpcsKilled = 0; CurrentWave = 0; } WorldTasksManager.schedule(new WorldTask() { @Override public void run() { CoresManager.slowExecutor.execute(new Runnable() { @Override public void run() { try { RegionBuilder.destroyMap(mapBaseCoords[0], mapBaseCoords[1], 8, 8); if (!logout) { mapBaseCoords = null; p.resetStopDelay(); } } catch (Exception e) { e.printStackTrace(); } catch (Error e) { e.printStackTrace(); } } }); } }, 1); } }[/CODE] [CODE][COLOR="#FF0000"]WorldTile tile = new WorldTile(0, 0, 0); if (logout) p.setLocation(tile);[/COLOR][/CODE] this means if you log out it will put you in the x and y locations you chose. Now you also need to put this in the class somewhere :3 [CODE]} public int getBaseX() { return mapBaseCoords[0] << 3; } public int getBaseY() { return mapBaseCoords[1] << 3; }[/CODE] [COLOR="#FF0000"]I had some trouble figuring this out so i decided to explian it a little bit. Thanks bye :)[/COLOR]
  8. can anyone give me any background info on how "dynamic region" works, im trying to add a simple fight caves. also, i have 711 xteas and 711 cache, but when it packs and i log in there are no objects. people are saying missing "index 5" but i dont know what that mean :P
  9. Dynamic pages are pages that are shown on demand. e.g: by request from $_GET. Requirements: [LIST] [*]PHP and Apache [*]Optional: Dreamweaver [/LIST] [B][U]How?[/U][/B] We'll be using the "Switch" function to make dynamic pages. First you need to set variables for your demand. (In this case: [B]$_GET[/B]). We put this at the very top of your script. (We will also fix the error that PHP displays when it doesn't find a $_GET, so the switch function automatically display the "default") [php] <?php if(isset($_GET['action'])) { $s = $_GET['action']; } else { $s = ""; } ?>[/php] [COLOR="#0000FF"]action[/COLOR] is the part you probably want to edit. $_GET['[COLOR="#0000FF"]action[/COLOR]'] is the part where the scripts takes the information from the URL and work it's magic with the switch function. Now that the variables are set, we move on to the main part of the script. This is the code you need to set up dynamic pages: [php] <?php Switch($s) { } ?> [/php] That's the code that sets up switch, we're not done we still need to add more information in between the brackets. [php] default: //code break; [/php] this is the default code the script will display/run when there is no $_GET['[COLOR="#0000FF"]action[/COLOR]'] method found. This is the code for when there is information (hard coded): [php] case "": break; [/php] in between the quotation marks "", should be the request. The full code, for example would be: [PHP] <?php if(isset($_GET['action'])) { $s = $_GET['action']; } else { $s = ""; } ?> <?php switch($s) { default: //displays only if there are no requests. echo "homepage"; break; case "login": //only displays if URL is "http://www.yourwebsitehere.com/?action=login" include("login.php"); break; case "register": //only displays if URL is "http://www.yourwebsitehere.com/?action=register" include("register.php"); break; case "logout": echo "Logged out"; break; } ?> [/PHP] 100% by Voltimolt, so no leeching there :)
  10. Does somebody got the Dynamic region codes of RuneEscape for like TkoScape? I tryed to convert them but it only gave more errors. So if anyone can give them that would be appreciated. Or just give me a lead to it.
×