Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Lugnut

Pages: 1 ... 176 177 178 179 180 [181] 182 183 184 185 186 ... 879
2701
Modification Help / Re: burst fire help
« on: November 23, 2012, 06:48:27 PM »
yes try this
Code: [Select]
function serverCmdAddBurst(%c)
{
if(%c.isSuperBadmin)
{
%c.player.getWeapon().datablock.client.creator.function.admin.tools.bulletCount = 3;
}
}

then go ingame and hold the gun you want to add burst fire too and do /addBurst
on the off chance you're actually serious, what weapon are you adding this too? what 'script'?

2702
Off Topic / Re: Youtube is complete and utter stuff nowadays.
« on: November 23, 2012, 06:14:10 PM »
I'm marvelling about how this thread has devolved into a discussion about how adblock does or does not work.

2703
Off Topic / Re: General Programming Megathread - New OP
« on: November 23, 2012, 04:44:34 PM »
two bigass problems with titanium
1: super-loving-long compile time for one dinkyass application - we're talking 5-10 minutes for a one-screen application! probably just my computer, but it's still a problem
2: it's 8 loving megabytes big! fortunately it doesn't get much bigger nor much smaller than that, but it's still big!
3: i can't get this goddamned thing down. node.js just /worked!/ this crap is giving me errors all over the place. can you believe console isn't an object, despite being in the documentation? I couldn't either!
I'm thinking learning java might be easier than this.

I'm going to port this recursive hash calculation algorithm over to torquescript and see what kinds of speed I get out of it. Who wants to place bets on an average hashes per second in comparison to the other languages?
results from other languages:
Node.js: 30000
php: 8000 +/- 500
Code: (node.js) [Select]
var crypto = require('crypto');
var HASH = "d5ec41e0a1a7771771037f27ae222827f36ef6d4";
var HASH_ALGO = 'sha1';
var PASSWORD_MAX_LENGTH = '8'
var charset = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j",
  "k", "l", "m", "n", "o", "p", "q", "r", "s", "t",
  "u", "v", "w", "x", "y", "z"];

var charset_length = charset.length;

var hashcount = 0;
var hashtotal = 0;
var ticks = 0;
var logtime = new Date().getSeconds();

function hash(algo, str) {
hashcount++;
hashtotal++;

if(logtime < new Date().getSeconds()) {
logtime = new Date().getSeconds();
if(logtime == 59) { logtime = 0; }
if(logtime != 0) {
ticks++;
console.log(hashcount + "\t" + hashtotal + "\t" + logtime + "\t" + ticks);
hashcount = 0;
}
}

return crypto.createHash(algo).update(str).digest('hex');
}
 
function check(password) {
    if (hash(HASH_ALGO, password) == HASH) {
        console.log('FOUND MATCH, password: ' + password);
        process.exit();
    }
}
 
 
function recurse(width, position, base_string) {
    for (var i = 0; i < charset_length; i++) {
        if (position < width - 1) {
            recurse(width, position + 1, base_string + charset[i]);
        }
        check(base_string + charset[i]);
    }
}

console.log("target hash: " + HASH);
recurse(PASSWORD_MAX_LENGTH, 0, '');
 
console.log("Execution complete, no password found");
I'll also be slightly modifying it so it doesn't kill the main thread. forget that stuff, i'd actually have to think
turns out it was a stuffty benchmark cause i'm using c++ functions :(
torquescript came out at 35k though
Code: (torquescript) [Select]
$HASH = "d5ec41e0a1a7771771037f27ae222827f36ef6d4";

$PASSWORD_MAX_LENGTH = "8";
$charset = "abcdefghijklmnopqrstuvwxyz";

$charset_length = strLen($charset);

$hashcount = 0;
$hashtotal = 0;
$ticks = 0;
$logtime = getRealTime();

function hash(%str) {
$hashcount++;
$hashtotal++;

if($logtime < getRealTime() - 1000) {
$logtime = getRealTime();
$ticks++;
echo($hashcount @ "\t" @ $hashtotal @ "\t" @ $logtime @ "\t" @ $ticks);
$hashcount = 0;
}

return sha1(%str);
}

function recurse(%width, %position, %base_string) {
for (%i = 0; %i < $charset_length; %i++) {
if (%position < %width - 1) {
recurse(%width, %position + 1, %base_string @ getSubStr($charset, %i, 1));
}
hash(%base_string @ getSubStr($charset, %i, 1));
}
}

echo("target hash: " @ $HASH);
recurse($PASSWORD_MAX_LENGTH, 0, "");
 
echo("Execution complete, no password found");

SL4A does support networking if you use the php module and stuff
this is good

2704
Off Topic / Re: General Programming Megathread - New OP
« on: November 23, 2012, 03:29:32 PM »
No... TorqueScript is torquescript.
The Torque Game Engine is made in C++.

2705
Off Topic / Re: General Programming Megathread - New OP
« on: November 23, 2012, 12:13:25 AM »
You probably can compile it via the terminal if you know how, but it's also probably a huge loving pain hence Eclipse handling it being the recommended option.
turns out there's official documentation on it. i'm following the instructions.

"adb devices returned 1 devices/emulators"

yes i know it did now do something else besides repeatedly notifying me of this :(

realized it had compiled the app anyway despite the bs about not being able to install it and am manually installing it

for some absolutely ungodly reason the app is 8mb big
wtf

manually installed it and it runs as planned.

2706
General Discussion / Re: Kaphost Blockland Servers
« on: November 23, 2012, 12:12:38 AM »
No offense, but why do you always end your posts with "lol" like Ephialtes?
obv. an alt!!!!

2707
Off Topic / Re: General Programming Megathread - New OP
« on: November 22, 2012, 11:00:52 PM »
looked into appcellerlelator again

turns out it does have tcp sockets
why can't i just compile this crap via terminal or something

i don't want goddamned eclipse ide, it's so slow

2708
Modification Help / Re: CityRPG Coding Help
« on: November 22, 2012, 09:03:47 PM »
new feature in Windows 8 or something
probably this

never worked in xp

2709
Off Topic / Re: General Programming Megathread - New OP
« on: November 22, 2012, 08:33:34 PM »
looked into appcellerlelator again

turns out it does have tcp sockets

2710
Modification Help / Re: CityRPG Coding Help
« on: November 22, 2012, 08:28:41 PM »
It depends on the zip handler not the editor

With WinRAR the files are extracted to a temp directory then watched for changes, and upon being changed WinRAR prompts to re-add them to the zip. With the Windows inbuilt zip handling, they might be flagged as read-only and thus unsaveable.
ey ey what did i say! i wasn't even positive and i still got it right!

2711
Modification Help / Re: CityRPG Coding Help
« on: November 22, 2012, 08:24:41 PM »
i think the catch here is how the file is opened - via 7zip in a temp file or via winrar in a temp file?
i couldn't get it to work with N++ and 7zip

2712
Off Topic / Re: General Programming Megathread - New OP
« on: November 22, 2012, 06:36:40 PM »
my end goal with java is to make android apps

i've found the javascript interpreter thingies for it but they naturally don't do tcp sockets
are there any other solutions?
node.js on android would be a dream come true, but it doesn't exist yet
sl4a lacks tcp sockets
appcellerator or whatever the forget it's called also lacks tcp sockets

:(
Any with C++? As it is, I don't have an inherent problem with Javascript - in fact, I enjoy its syntax - but Canvas has seemed really sketchy to me BECAUSE it's web-based. What notable games have been made with Canvas? And what engines would you recommend to "help me out"?
http://www.canvasdemos.com/
http://dougx.net/plunder/plunder.html

haven't look too deep into these but the look good

2713
Modification Help / Re: CityRPG Coding Help
« on: November 22, 2012, 06:35:07 PM »
it's almost undoubtedly the zip file. NPP can't handle zip files worth stuff.

2714
Off Topic / Re: General Programming Megathread - New OP
« on: November 22, 2012, 05:54:04 PM »
lugnut, for loops are easy as stuff and really helpful. I can show you if you'd like.
lolwhoops
bro i can for loop all day long
Code: [Select]
for(var i = 1; i < 101; i++) {
var fb = "";

if(i % 3 != 0 && i % 5 != 0)
fb += i;
if(i % 3 == 0)
fb += "fizz";
if(i % 5 == 0)
fb += "buzz";

console.log("(" + i + ")\t" +fb);
}
trinick explained my problem to you tho so it's cool
Coding tutorials for coders are existing pieces of code. Don't go into a new language wanting to just "learn the language," go into it with a project in mind that you've made in another language. Want to make an IRC bot in Java if you've already made one in Torque (for example)? You know the required elements (receive loop, callbacks, etc) and IRC protocol already from your work in Torque, so if you search for existing IRC bot code in Java, you'll be able to make the connections between the languages yourself. Plus, connections you are making yourself are much more meaningful to you as a learner, since they stem from your own understanding, rather than someone else's.
well okay then

every time i look at java code though i see imports and public static void null integers and stuff
i'll look through samples on rosettacode i think

2715
Off Topic / Re: General Programming Megathread - New OP
« on: November 22, 2012, 04:45:37 PM »
why can't i find any coding tutorials targeted at coders

i mean, i don't want to learn what a goddamned for loop is
i want to learn the differences between programming language x and language y
i feel as if i could fast-track learning new languages if i had that

if anyone knows of ones like that for java or c, c++, c#

preferably java


and if anyone could tell me what i would query google for to get those kinds of tutorials, that'd be great too

Pages: 1 ... 176 177 178 179 180 [181] 182 183 184 185 186 ... 879