Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 1,780
» Latest member: Alexc99xd
» Forum threads: 4,055
» Forum posts: 83,622
Full Statistics
|
Online Users |
There are currently 532 online users. » 2 Member(s) | 527 Guest(s) Bing, Google, Yandex, EpicMidget, Jeremiah
|
Latest Threads |
Count to 500 before a mod...
Forum: Village Games
Last Post: Dan-83
2 hours ago
» Replies: 5,544
» Views: 1,895,216
|
Last post wins!
Forum: Village Games
Last Post: Stunt
3 hours ago
» Replies: 1,882
» Views: 808,632
|
Folding for people
Forum: Folding at Home
Last Post: Stunt
6 hours ago
» Replies: 28
» Views: 2,154
|
Count to 600 before an ad...
Forum: Village Games
Last Post: Dan-83
8 hours ago
» Replies: 2,393
» Views: 802,149
|
Jiggmin's first words on ...
Forum: Discussion Hall
Last Post: dotime
Yesterday, 10:47 AM
» Replies: 4
» Views: 215
|
New Game I'm working on P...
Forum: Blogs
Last Post: Camer the Dragon
Yesterday, 8:18 AM
» Replies: 2
» Views: 81
|
PR2 Part Ideas Index
Forum: PR2 Suggestions
Last Post: Camer the Dragon
5th May 2024, 5:31 PM
» Replies: 11
» Views: 8,468
|
Let's get this thread to ...
Forum: Village Games
Last Post: ~JBG~
5th May 2024, 4:52 PM
» Replies: 16,280
» Views: 2,685,745
|
Level of the Week! (PR2)
Forum: Platform Racing 2
Last Post: Overbeing
5th May 2024, 1:09 AM
» Replies: 436
» Views: 141,617
|
Location of smoke apparat...
Forum: Blogs
Last Post: Adulock77
4th May 2024, 4:34 PM
» Replies: 2
» Views: 109
|
|
|
hey its drager |
Posted by: drager980 - 14th December 2018, 11:19 PM - Forum: Welcoming Gates
- Replies (5)
|
|
hey i used to go by drager, drager980 and we love ninga
i havent been here in a long time but i was active a lot during most the span of pr2 and pr3
i just graduated high school recently and i remember not even being in HS back when i was on here ahah
would love to catch up with anyone from back then but for everyone nice to meet you :d
|
|
|
Delete it! |
Posted by: AspectZero - 12th December 2018, 2:36 PM - Forum: Village Games
- Replies (5)
|
|
A game where you post a reply and delete it before any one can quote you, if you get quoted, you lose!
|
|
|
Ninja Hat |
Posted by: bls1999 - 11th December 2018, 10:34 PM - Forum: PR2 Suggestions
- No Replies
|
|
A user on PR2 sent me this hat idea since they don't use JV2.
panda2878 Wrote:idea with this new hat your sword swings will be in slow motion and linger in the spot you used it show as a blue wave and a flying sword it will hit anyone who touches it until the animation goes away and your bullets and ice wave will also go in slow motion too
|
|
|
Therapist |
Posted by: Bluelightning - 10th December 2018, 1:47 PM - Forum: Village Games
- Replies (1)
|
|
A Therapist turns to a therapist therapist for therapist therapy. Tired of all the therapist therapy, the therapist therapist turns to a therapist therapist therapist who is at the therapist therapist therapist therapist discussing therapist therapist therapist therapy to a therapist therapist therapist therapist therapist therapist. He goes to the therapist therapist therapist therapist therapist therapist but he won't get  therapist  therapist  therapist  therapist  therapist therapy if the therapist therapist therapist therapist therapist therapist there is pissed.
|
|
|
Snowy JV |
Posted by: bls1999 - 9th December 2018, 8:44 PM - Forum: Announcements
- Replies (4)
|
|
In honor of it being winter in most of the world (looking at you, @Nemo Nation), I've changed the normal bubbles to something a little more appropriate. Stay warm!
|
|
|
PHP Find/Replace Script |
Posted by: bls1999 - 8th December 2018, 5:22 AM - Forum: Coding and Development
- Replies (2)
|
|
When sifting through old code trying to find different names of things, I've found it extremely useful and time-saving to run a PHP script from the command line that searches through all the files in a directory on my computer for a search term. On this particular project, I have it set to sift through ActionScript files only, but you can set it to anything. Here it is, if anyone's interested:
PHP Code: <?php
$base_path = __DIR__ . "/fla";
if (!isset($argv[2])) { $argv[2] = false; }
$files = getDirContents($base_path); search_files($files); die();
function getDirContents($dir, &$results = array()){ $files = scandir($dir);
foreach($files as $key => $value){ $path = realpath($dir.DIRECTORY_SEPARATOR.$value); if(!is_dir($path)) { $results[] = $path; } else if($value != "." && $value != "..") { getDirContents($path, $results); $results[] = $path; } }
return $results; }
function search_files($files) { global $argv;
$continue = false; $filesChanged = 0; foreach ($files as $file) { $file_path = $file; if (substr($file, -3, 3) == ".as") { $find = $argv[1]; $strict = $argv[2] == 'true' ? true : false; $file = file_get_contents($file_path); if ($strict === false && strpos($file, $find) !== false && !isset($argv[3])) { echo "$file_path\n"; } elseif ($strict === true && preg_match("/\b$find\b/", $file) && !isset($argv[3])) { echo "$file_path\n"; } elseif (isset($argv[3])) { if ($continue === false) { echo "\nReplace \"$find\" with \"$argv[3]\"?\nWARNING: THIS CANNOT BE UNDONE.\n\nContinue? (yes/no): "; $reply = trim(strtolower(fgets(fopen("php://stdin","r")))); if ($reply == 'true' || $reply == 't' || $reply == 'yes' || $reply == 'y') { $continue = true; echo "\n"; } else { break; } } if ($strict === false && strpos($file, $find) !== false) { file_put_contents($file_path, str_replace($find, $argv[3], $file)); echo "$file_path\n"; $filesChanged++; } elseif ($strict === true && preg_match("/\b$find\b/", $file)) { file_put_contents($file_path, preg_replace("/\b$find\b/", $argv[3], $file)); echo "$file_path\n"; $filesChanged++; } else { continue; } } } } $continue = false; if ($filesChanged > 0) { echo "\nTotal files changed: $filesChanged\n\n"; } else { if (!isset($argv[3])) { echo "\n"; } else { echo "\nNo files to be changed.\n\n"; } } }
The arguments are:
[0] = File
[1] = Find
[2] = Strict? (yes/true uses preg_match to match exact words, no/false uses strpos for a character match)
[3] = Replace
A sample run on the command line for me would be:
Code: php /Users/ben/Projects/SuperSecretThings/search.php "Example" true
That would give me a strict, case-sensitive result for the complete word "Example" as opposed to also getting a result for "ExampleData".
Anyway, yep. I hope y'all learned something and/or have a use for the code in your own projects.
|
|
|
|