UGX-Mods Login

or login with an authentication provider below
Sign In with Google
Sign In with Twitter
Sign In with Discord
Sign In with Steam
Sign In with Facebook
Sign In with Twitch

[Forum Game] Find the Error

HOT
broken avatar :(
Created 12 years ago
by JR-Imagine
0 Members and 1 Guest are viewing this topic.
8,397 views
broken avatar :(
×
broken avatar :(
Location: gbSomewhere in the UK
Date Registered: 20 July 2013
Last active: 5 months ago
Posts
79
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
×
AoKMiKeY's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AoKMiKeY's Contact & Social Links
Code Snippet
Plaintext
thisIsSomethingFun()
{
yes = "no";
no = "yes";

logicalYes = false;
logicalFalse = true;

if( yes != no )
{
no = "yes";
logicalYes = true;
logicalFalse = false;
if( (logicalYes && !logicalFalse) && yes != no )
{
while( !logicalFalse )
{
if( logicalYes )
logicalYes = false;
if( logicalFalse )
logicalFalse = false;
logicalFalse = true;
wait 0.05;
}
if( !logicalFalse )
self iPrintLn( " logical false is set wrong " );
else
{
// You're not in a loop, so can't use continue, commented out
/*
if( logicalFalse )
continue;

if( no != "no" )
continue;

if( yes != "yes" )
continue;
*/

// Took out if( logicalYes )
if( !logicalYes )
{
newLogical = logicalYes;
oldLogical = newLogical;
if( oldLogical != logicalFalse )
nub = true;

if( nub )
{
nub = false;
if( !nub && (logicalYes != oldLogical))
{
oldLogical = no;
if( no == "yes" )
no = false;
else
no = true;
}
else
{
oldLogical = logicalFalse;
logicalFalse = oldLogical;
logicalYes = oldLogical;
no = logicalFalse;
yes = logicalYes;

if( logicalYes )
{
logicalFalse = false;
if( no != true )
{
logicalFalse = true;
logicalYes = false;
if( oldLogical != logicalYes )
{
noLogic = true;
self iPrintLn("fuck it i give up. Logic is simple when logic is not simple");
}
}
}
}
}
}
else
logicalYes = true;
}
}
}
}
You made my brain blow up... ;-;

New one:
Code Snippet
Plaintext
lolz()
{
for( ; ; wait( 5 ) )
killEveryone();
}

killEveryone( exception )
{
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if( players[i] != exception )
players[i] doDamage( players[i].health + 666, (0,0,0) );
}
}

Damn
Last Edit: December 07, 2014, 05:34:22 pm by aokmikey
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 10 months ago
Posts
602
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
Code Snippet
Plaintext
thisIsSomethingFun()
{
yes = "no";
no = "yes";

logicalYes = false;
logicalFalse = true;

if( yes != "no" ) // this will never be ran
{
no = "yes";
logicalYes = true;
logicalFalse = false;
if( (logicalYes && !logicalFalse) && yes == no ) // this will never be ran
{
while( !logicalFalse )
{
if( logicalYes )
logicalYes = false;
if( logicalFalse )// this will never be ran
logicalFalse = false;
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 27 July 2013
Last active: 7 years ago
Posts
39
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
×
arhowk's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
arhowk's Contact & Social Links
i believe i found them all but I'm under mod lock. >.<

this isnt as much of a typo as how much you can understand what the system is doing

Code Snippet
Plaintext
//storageVector contains:
//command0
//     command0.conditionalStatus = Structure.if
//     command0.shouldRun = false
//command1
//     command1.conditionalStatus = Structure.conditionalPause
//command2
//     command2.conditionalStatus = Structure.if
//     command2.shouldRun = true
//command3
//     command3.start = 3
//     command3.timeout =2
//command4
//     command4.conditionalStatus = Structure.endif
//command5
//     command5.start = 3
//     command5.timeout = 2
//command6
//     command6.conditionalStatus = Structure.conditionalEndPause
//
//command7
//     command7.conditionalStatus = Structure.endif
//the entire thing is inside of an if false statement, but the system still pauses for 2 seconds at 3 seconds
public void execute()
        {
            if(!init){
                loopTimer.start();
                loopTimer.reset();
                init = true;
            }
            if(finished) return;
            SmartDashboard.putNumber("loopTimer", loopTimer.get());
            int numOfRunningCommands = 0; //Used to make sure that it still has commands to be run and doesn't loop forever
            long nestedIfs = 0;
            long nestedIfFalse = 0;
            long nestedIfTrue = 0;
            long nestedPauseStop = 0;
            long nestedPause = 0;
           
            Enumeration runningCommandsIteration = storageVector.elements(); //List of objects in the storage hashtable
            Structure nextCommand; //Temporary storage for the next object in the hash
            while(runningCommandsIteration.hasMoreElements()){
                nextCommand = (Structure)(runningCommandsIteration.nextElement()); //Retrieves the next element Object and typecasts it to TimedCommnad
               
                if(nextCommand.conditionalStatus != 0)
                {
                    Conditional cond = (Conditional)nextCommand.command;
                    switch(nextCommand.conditionalStatus)
                    {
                        case Structure.conditionalPause:
                            nestedPause++;
                            break;
                           
                        case Structure.conditionalEndPause:
                            if(nestedPauseStop >> (nestedPause - 1) == 1)
                            {
                                loopTimer.stop();
                                loopTimerStopped = true;
                                return;
                            }else{
                                nestedPause--;
                                nestedPauseStop = nestedPauseStop &~ (1 << nestedPause);
                                if(loopTimerStopped && nestedPauseStop == 0)
                                {
                                    loopTimer.start();
                                    loopTimerStopped = false;
                                }
                            }
                            break;
                           
                        case Structure.conditionalWhile:
                            if(nestedIfFalse == 0 //No nested if false?
                                    && !nextCommand.finished //Not finished?
                                    && nextCommand.start < loopTimer.get()  //Time is proper?
                                    && !cond.shouldRun(file)){ //Run the command. If it pauses, than pause everything else.
                                numOfRunningCommands++;
                                nestedPauseStop = nestedPauseStop | (1 << (nestedPause-1));
                            }else if(!nextCommand.finished && //Else if it should've run but didnt the command returned false
                                    nextCommand.start < loopTimer.get()){ //so disable the while.
                               
                                nextCommand.finished = true;
                            }else{
                            }
                            break;
                        case Structure.conditionalIf:
                            if(!cond.shouldRun(file))
                            {
                                nestedIfFalse = nestedIfFalse | (1 << nestedIfs);
                            }else{
                                nestedIfTrue = nestedIfTrue | (1 << nestedIfs);
                            }
                           
                            nestedIfs++;
                            break;
                           
                        case Structure.conditionalEndIf:
                            nestedIfTrue = nestedIfTrue & (1 << (--nestedIfs));
                            nestedIfFalse = nestedIfFalse & (1 << (nestedIfs));
                            break;
                           
                        case Structure.conditionalElse:
                            /*if(nestedIfFalse >> (nestedIfs - 1) == 1)
                            {
                                nestedIfFalse = nestedIfFalse &~ (1 << (nestedIfs - 1));
                            }else{
                                nestedIfFalse = nestedIfFalse | (1 << (nestedIfs-1));
                            }*/
                            break;
                           
                        case Structure.conditionalElseIf:
                            if(nestedIfTrue >> (nestedIfs - 1) == 0){ ///making sure that another else wasn't returned.
                                if(nestedIfFalse >> (nestedIfs - 1) == 1)
                                {
                                    if(cond.shouldRun(file))
                                    {
                                        nestedIfFalse = nestedIfFalse &~ (1 << (nestedIfs - 1));
                                        nestedIfTrue = nestedIfTrue | (1 << (nestedIfs - 1));
                                    }
                                }else if(nestedIfFalse >> (nestedIfs - 1) == 0){
                                    nestedIfFalse = nestedIfFalse | (1 << (nestedIfs-1));
                                }
                            }else{
                                nestedIfFalse = nestedIfFalse | (1 << (nestedIfs-1));
                            }
                           
                            break;
                           
                        default:
                            System.out.println("[AUTON] Conditional type passed that does not exist. O.O");
                    }
                   
                }else if(nestedIfFalse == 0 //no false if statements
                        && loopTimer.get() < nextCommand.timeout + nextCommand.start){ //within time frame
                   
                    if(loopTimer.get() > nextCommand.start){ //if the command should be running,
                        if(nextCommand.command == null)
                        {
                            System.out.println("[AUTON] Null Command Passed! Woops. How'd that happen? Report to Jake");
                        }else{
                            nextCommand.command.execute(file);
                            numOfRunningCommands += 1;
                        }
                        nextCommand.hasStarted = true;
                    }else{ //else, the command would be running but it hasn't met its start point so the tcg should still run because it hasnt run that command yet
                        numOfRunningCommands += 1;
                    }
                   
                }else if(nextCommand.hasStarted && !nextCommand.hasRunFinale && nextCommand.timeout + nextCommand.start < loopTimer.get()){
                    nextCommand.hasRunFinale = true;
                    if(nextCommand.command != null)
                    {
                        nextCommand.command.end();
                    }
                }
                   
            }
            if(numOfRunningCommands == 0)
            {
                finished = true; //If theres no commands left, exit
            }
        }
broken avatar :(
×
broken avatar :(
Location: gbSomewhere in the UK
Date Registered: 20 July 2013
Last active: 5 months ago
Posts
79
Respect
Forum Rank
Rotting Walker
Primary Group
Donator ♥
My Groups
More
×
AoKMiKeY's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
AoKMiKeY's Contact & Social Links
Code Snippet
Plaintext
You made my brain blow up... ;-;

New one:
[code]
lolz()
{
for( ; ; wait( 5 ) )
killEveryone();
}

killEveryone( exception )
{
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if( players[i] != exception )
players[i] doDamage( players[i].health + 666, (0,0,0) );
}
}

pretty sure its just the doDamage because the source of the damage is at (0, 0, 0)
could be wrong. not really looking for anything too hidden
broken avatar :(
×
broken avatar :(
Location: be
Date Registered: 17 August 2013
Last active: 5 years ago
Posts
369
Respect
Forum Rank
Perk Hacker
Primary Group
Scripter
My Groups
More
My Contact & Social Links
More
Personal Quote
Web & Software Developer and Designer
Signature
"Deleted code is debugged code." - Jeff Sickel
"Mathematicians stand on each others' shoulders and computer scientists stand on each others' toes." - Richard Hamming
×
JR-Imagine's Groups
Scripter Has shown effort and knowledge in the area of scripting while being a part of the UGX-Mods community.
Eh... Mikey just made me remember that would actually work, no need for isDefined( exception ). :please: So eh... Nvm... :poker:
broken avatar :(
×
broken avatar :(
Location: us
Date Registered: 2 April 2014
Last active: 3 months ago
Posts
480
Respect
Forum Rank
Perk Hacker
Primary Group
Donator ♥
My Groups
More
My Contact & Social Links
More
Personal Quote
If it's not perfect, you'll never see it.
Signature
Learn by doing, not copy and pasting.

Enjoy my 2015 contest map, a simple map with bo1-bo2 features
http://ugx-mods.com/forum/index.php?topic=14968.msg149200#
×
Centric's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
Centric's Contact & Social Linkscentric_centriccInvictable
Code Snippet
Plaintext
vanish();
{
gone = getentarray("part", "targetname");
for(g=0;g<gone.size;g++)
gone[g] hide();
}

Yea this really happened don't judge. It's pretty easy to find too  :please:
Last Edit: December 07, 2014, 10:59:42 pm by Centric
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 27 July 2013
Last active: 7 years ago
Posts
39
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
×
arhowk's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
arhowk's Contact & Social Links
Code Snippet
Plaintext
vanish()
{
gone = getentarray("part", "targetname");
for(g=0;g<gone.size;g++)
gone[g] hide();
}

Yea this really happened don't judge. It's pretty easy to find too :facepalm1:

lol
broken avatar :(
×
broken avatar :(
Senpai
Location: us
Date Registered: 28 September 2013
Last active: 10 months ago
Posts
602
Respect
Forum Rank
Zombie Enslaver
Primary Group
Box Mappers Elite
My Groups
More
My Contact & Social Links
More
×
arceus's Groups
Box Mappers Elite
Box Mappers Elite
arceus's Contact & Social LinksarceusNT
I REVIVE THEE!!!!

Code Snippet
Plaintext
forum_timer()
{
waittill("forum_page_dead", page)

thread revive_thread( forum_post );
}

revive_thread( forum_post )
{
if(forum_page == dead)
{
forum_page revive();
forum_page notify("page_revived")
}
}
Last Edit: December 13, 2014, 08:05:26 pm by arceus
broken avatar :(
  • DeletedUser
  • Deleted Member
×
broken avatar :(
DeletedUser
This user is deleted :(

Code Snippet
Plaintext
lolz()
{
for( ; ; wait( 5 ) )
killEveryone();
}

killEveryone( exception )
{
players = getEntArray( "player", "classname" );
for( i = 0; i < players.size; i++ )
{
if( players[i].playername != exception )
players[i] doDamage( players[i].health + 666, (0,0,0) );
}
}
broken avatar :(
×
broken avatar :(
Location: usUnited States
Date Registered: 27 July 2013
Last active: 7 years ago
Posts
39
Respect
Forum Rank
Legless Crawler
Primary Group
Donator ♥
My Groups
More
×
arhowk's Groups
Donator ♥ Benevolent Soul who has our eternal gratitude and exclusive access to betas and the donator section of the forum.
arhowk's Contact & Social Links
Ray u posted that code earlier and it had no error... Arceus ur missing a semicolon in the first fund after waittill not to mention that u use the forum-page variable when u pass the forum-post variable
Last Edit: December 13, 2014, 11:57:29 pm by arhowk

 
Loading ...