While Loop Freezes game

i am coding for GTA IV
the game freezes when i use this while loop
while (tb == true)
if (Game.isKeyPressed(begkey) && ip == false)
beg_playing();
Game.Console.Print(begkey.ToString() + " Pressed");
Game.Console.Print("Animation Cleared");
Player.Character.Task.ClearAllImmediately();
Player.Character.Task.PlayAnimation(beggarsitting, "beggar_beg", 8);
Game.Console.Print("beggar_beg anim played");
ip = true;
gmoney.Start();
while (bp == true) { Wait(100); }
gback();
return;
if (Player.Character.isDead)
cleanup();
Here is the full code
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
using System.Windows.Forms;
using System.Drawing;
using System.Diagnostics;
using System.Collections.Generic;
using GTA;
using GTA.Native;
namespace Beggar
public class ambBeggar : Script
bool tb = false;
bool bp = true;
bool ip = false;
Ped rped;
AnimationSet beggarsitting;
//AnimationSet beggarstanding;
Keys begkey;
GTA.Timer gmoney;
public ambBeggar()
gmoney = new GTA.Timer(120000);
gmoney.Tick += gmoney_Tick;
begkey = Settings.GetValueKey("Beg", "Beggar Mod", Keys.B);
if(!File.Exists(Settings.Filename))
Settings.SetValue("Beg", "Beggar Mod", Keys.B);
this.Interval = 100000;
this.Tick += new EventHandler(ambBeggar_get);
this.ConsoleCommand += new ConsoleEventHandler(ambBeggar_ConsoleCommand);
public void ambBeggar_get(object sender, EventArgs e)
if(tb == true && !rped.Exists())
rped = World.GetClosestPed(Player.Character.Position,20);
public void gmoney_Tick(object sender, EventArgs e)
if (rped.Exists())
rped.Task.GoTo(Player.Character.Position.Around(2));
Pickup.CreateMoneyPickup(rped.Position, 1000);
rped.NoLongerNeeded();
ip = false;
if(gmoney.isRunning)
gmoney.Stop();
public void ambBeggar_ConsoleCommand(object sender, ConsoleEventArgs e)
if (e.Command == "beggar_on")
tb = true;
Game.Console.Print("Beggar Mod By Mora Hannover");
Game.Console.Print("beggar mod toggled");
//Function.Call("REQUEST_ANIMS", "amb@beg_sitting");
Game.Console.Print("loading anim set amb@beg_sitting");
beggarsitting = new AnimationSet("amb@beg_sitting");
Wait(5000);
//Function.Call("REQUEST_ANIMS","amb@beg_standing");
// if (Function.Call<bool>("HAVE_ANIMS_LOADED", "amb@beg_sitting") && Function.Call<bool>("HAVE_ANIMS_LOADED","amb@beg_sitting"))
Game.Console.Print("amb@beg_sitting available");
msg("Press " + begkey.ToString() + " To Beg", 5000);
//beggarstanding = new AnimationSet("amb@beg_standing");
Player.Character.Animation.Play(beggarsitting, "beggar_sit", 8, AnimationFlags.Unknown05);
Game.Console.Print("beggar_sit anim played");
while (tb == true)
if (Game.isKeyPressed(begkey) && ip == false)
beg_playing();
Game.Console.Print(begkey.ToString() + " Pressed");
Game.Console.Print("Animation Cleared");
Player.Character.Task.ClearAllImmediately();
Player.Character.Task.PlayAnimation(beggarsitting, "beggar_beg", 8);
Game.Console.Print("beggar_beg anim played");
ip = true;
gmoney.Start();
while (bp == true) { Wait(100); }
gback();
return;
if (Player.Character.isDead)
cleanup();
if (e.Command == "beggar_off")
cleanup();
public void msg(string sMsg, int time)
Function.Call("PRINT_STRING_WITH_LITERAL_STRING_NOW", new Parameter[] { "STRING", sMsg, time, 1 });
public void beg_playing()
if (GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Player.Character, "amb@beg_sitting", "beggar_beg") == false)
bp = false;
if (GTA.Native.Function.Call<bool>("IS_CHAR_PLAYING_ANIM", Player.Character, "amb@beg_sitting", "beggar_beg") == true)
bp = true;
public void cleanup()
tb = false;
ip = false;
bp = false;
Game.Console.Print("beggar_mod off :'(");
Player.Character.Task.ClearAllImmediately();
if(gmoney.isRunning)
gmoney.Stop();
public void gback()
Player.Character.Task.ClearAllImmediately();
Player.Character.Task.PlayAnimation(beggarsitting, "beggar_sit", 8, AnimationFlags.Unknown05);
Game.Console.Print("beggar_sit anim played"); return;

Hello,
Have you tried to debug your code step by step? As it's very hard for others to reproduce your problem, I recommend that you firstly debug your code, find out which line causes the problem. And make sure that you don't cause infinit loop in your code, as
I can see from your code, if the variable "tb" or "bp" is always true, your code will go into an infinit loop. This will cause the freeze of the application.
while (tb == true)
if (Game.isKeyPressed(begkey) && ip == false)
beg_playing();
Game.Console.Print(begkey.ToString() + " Pressed");
Game.Console.Print("Animation Cleared");
Player.Character.Task.ClearAllImmediately();
Player.Character.Task.PlayAnimation(beggarsitting, "beggar_beg", 8);
Game.Console.Print("beggar_beg anim played");
ip = true;
gmoney.Start();
while (bp == true) { Wait(100); }
gback();
return;
if (Player.Character.isDead)
cleanup();
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Program freeze during while loop operation

    Dear all.
    I have a program that controls mass flow controller and LabJack data acquistion unit and I have a difficulty in fixing a program bug that cause while loop freeze after certain period time(about 1-10 hours after run start).
    Basically, the program reads a control profile that consists of two rows of data (two steps) from the front panel and controls the flow controller and Labjack.
    There are three while loops and one is for reading data from mass flow controller and writing control data to that device and LabJack, the other one is to monitor the elapsed time to change the control profile, and the another one is to measure the data from the Aglient miliohm-meter.
    Each step (each control profile) has data for flow rate and duration time, etc. Once the time(duration) elaspsed, the control profile switch to the second profile (second row) and the software keeps running with new control profile. After the second step, the control step comes back to the first profile. This sequence keeps going in the while loop.
    The problem that I encountered is that after a certain amount of time, the control profile is no longer switched to the other one, and even though I change the step manually, the profile is not switched to the other one. I found that there is no error message from the instrument when this thing happens and no memory increase, but the CPU usage jumps up to 50 ~ 70%. (You can see the screen shot in the attached file). Normal CPU usage is between 2 ~ 10 % for this program. I use LabView 8.2.
    I tried to figure out this problem , but it's too difficult for me to find the bug.
    It would be appreciated if you can give me some hints and suggestions.
    Thank you very much.
    Yoon.
    Message Edited by swsyoon on 06-25-2009 05:49 PM
    Message Edited by swsyoon on 06-25-2009 05:51 PM
    Attachments:
    RH cycling with LabJack_final.vi ‏401 KB
    RH cycling_latest.zip ‏539 KB

    My general suggestion for a problem like this, is to try and isolate the problem.  Cut things out of your program, until you have the simplest possible program that still causes the problem.
    Also, perhaps you can make the program go faster and get the problem to happen quicker, for testing. 

  • Flash Player freezes on 2nd monitor while playing fullscreen game on 1st one

    Flash Player freezes (shows something like slideshow with frame rate near 1-2 per sec, everything is ok with sound) on 2nd monitor while playing fullscreen game on 1st one.
    Windows 8, flash player 12, chrome.
    Tried to use other versions of flashplaers, other browsers - didnt help me.
    SOLVED: my computer for some reason didnt want to download updates. that was the reason of this problem.
    Thanks in advance.
    Philip

    Ok, Have just finished re-starting comp and have installed 10.3 & much to my suprise the games on Kongregat and Facebook are working. Have also, just to be safe checked the Firefox plug-in to make sure it was running the correct plug-in
    Shockwave Flash
    Shockwave Flash 10.3 r183
    I imagine this is it...I would have thought it should've been adobe flash but???  I will proccede to put it through the normal paces and pray it doesn't  die on me   will update as needed on this page.

  • I have a imac27" i resently upgraded to osx10.09 and i play d3 but lately my computer , while playing the game all sudden freezes and then boots me out and my computer shuts down and restarts all over again. cant figure this out? any suggestions

    i have a 27inch mac and recently upgraded to operatiing system 10.09. i game d3 and while playing the game it freezes sometimes and then shuts down the computer and restarts for no reason. sometimes with minutes, other times its after many hours. Any ideas would be appreciated.

    could be overheat since the computer also shuts down

  • Ending Java War game with while loop

    How would i go about ending a java war game witha while loop. I want the program to run until all of the values of one of the arrays of one of the players split decks has all null values.

    GameObject[] theArrayInQuestion;
    // populate array somehow or other
    void methodWithLoop() {
       while(arrayNotNull(theArrayInQuestion)) {
       // do stuff
    boolean arrayNotNull(Object[] array) {
      int len = array.length;
      for(int i = 0; i < len; i++) {
        if ( array[i] != null ) {
          return true;
      return false
    }

  • Swing application crashes in while loop

    The following code is a fragment from a battleships game using Swing.
    Once the user has placed all their ships on the board, this function is called. The problem is, it does not allow the user to guess the computers ships location. When a location on the comkputers grid is clicked nothing happens. Is the while loop looping too fast for the app to recognise that a button has been clicked?
    private void startGame(){   
              //while somebody hasnt guessed all their opponents ships
              while (!(isGameOver())){
                   //if users turn                             
                  if(myTurn)
                        //set value of last button clicked to -1
                        NumberOfLastButtonClicked = -1;
                        //enable buttons for user
                       enableButtons(false, true);     
                       //add note on screen to indicate it is the user's turn
                       appendToStatus("Guess opponents fleet locations:");              
                        //this loops around until the variable has been assigned a value between
                        //0 and 99 i.e a button has been clicked
                       while (NumberOfLastButtonClicked==-1){
                        //disable buttons for user
                        disableButtons(false, true);
                        //set user turn to false
                        myTurn = false;
                  //its computers turn
                  else
                       //computer takes a guess
                       computerGuess();
                       //set user turn to true
                       myTurn=true;
                 //execute code to finish game
                 endGame();
        }

    You immediately turn disable the users buttons after telling them it's their turn. I'm guessing that's not what you want to do.
    The style of programming you are using here is polling. This is a problematic way to do things.
    Instead of looping and looking to see what was selected, you should have the users input trigger the processing directly. Add a listener to the button that sets the my turn state and calls the a game() method.

  • Calling web service method.Stuck in while loop

    I am implementing a board game using asp.net web service. Players connect to this web service and play.
    Once player click on a cell in board it should be written to web service and other players board repaint according to that click.Writtting to web and reading is working, but the switch player method in below do not work.It stuck in the while loop.Even other player has played this player do not identify he has played it wait in the loop.
    private void switchPlayer(String player){
            try { // This code block invokes the ServiceSoap:switchPlayer operation on web service
                webservice.Service service = new web.Service_Impl();
                webservice.ServiceSoap serviceSoap = service.getServiceSoap();
                while(serviceSoap.switchPlayer(player)!="aPlayer"){
                   System.out.println("It's oppenents turn");//Stuck here
                    //remote player already exists?
              //   readLabel();
                System.out.println("It's my turn");//don't come here even player b played
                       }  catch(Exception ex) {
                // TODO handle custom exceptions here
              }

    Does some one knows url of similar type game
    designing.I would suggest that you get your basics right before going into that stuff.

  • Trouble with while loop, not sure what to put in it in my project

    I'm making a class to a simple command line craps game. I must use a while loop to implement craps rules. The rules that i was given are:
    if your first roll is a 4, 5, 6, 8, 9, or 10, you roll again until either you get a 7 (you lose) or you get the number from your first roll. (i thought 7 or 11 wins, like in the next example)
    yeah, thats right, not very good directions. The first directions i had for a different way of doing it using if and else statements were:
    The player rolls the two dice.
    If the sum of the resulting die values is 7 or 11, the player wins.
    If the sum is 2, 3, or 12, the player loses.
    If something else is rolled, the player has to roll again to determine the outcome.
    If the sum of the second roll is the same as what the player rolled the first time, the player wins. Otherwise the player loses.
    (You might get a pair of dice and play a few rounds to try it.)
    here's my code that i have so far for my craps class, in the middle section, i have previous code that i used for if else statements, that is what im trying to replace: package games;public class Craps {
    private Dice dice1;
    private Dice dice2;
    private int gamesPlayed;
    private int gamesWon;
    private boolean lastGameWon;
    private boolean gameOver;
    private int firstRoll;
    private int secondRoll;
    public Craps() {
    dice1 = new Dice(6);
    dice2 = new Dice(6);
    gamesPlayed = 0;
    gamesWon = 0;
    lastGameWon = false;
    firstRoll = 1;
    secondRoll = 2;
         //returns firstroll
    public int getFirstRoll(){
    return firstRoll;
         //returns secondroll
    public int getSecondRoll(){
    return secondRoll;
    public int getGamesPlayed(){
    return gamesPlayed;
    public int getGamesWon(){
    return gamesWon;
    public boolean lastGameWon(){
    return lastGameWon;
         public int nextSum()
         dice1.roll();
         dice2.roll();
         return dice1.getSideUp() + dice2.getSideUp();
    public void play()
              firstRoll = nextSum();
    if (firstRoll == 7 || firstRoll == 11)
              gameOver = true;
              gamesWon++;
              if (firstRoll == 2 || firstRoll == 3 || firstRoll == 12)
              gameOver = true;
                   else{
                   gameOver = false;
              while (gameOver == false)
              secondRoll++;
    public String toString()
    return "games - " + gamesPlayed + ", won - " + gamesWon + ", last game won - " + lastGameWon + " First Roll - " + firstRoll +
    ", Second Roll - " + secondRoll;
    i'm really confused on how to get the while loop will keep starting the game over if it is false, am i using the right approach? Also i have to use a while loop, its for a school project.
    thanks.

    The code you asked for could be:
    package games;
    public class Craps {
        private Dice dice1;
        private Dice dice2;
        private int gamesPlayed;
        private int gamesWon;
        private boolean lastGameWon;
        private boolean gameOver;
        private int firstRoll;
        private int secondRoll;
        public Craps()
            dice1 = new Dice(6);
            dice2 = new Dice(6);
            gamesPlayed = 0;
            gamesWon = 0;
            lastGameWon = false;
            firstRoll = 1;
            secondRoll = 2;
         //returns firstroll
        public int getFirstRoll(){
            return firstRoll;
         //returns secondroll
        public int getSecondRoll(){
            return secondRoll;
        public int getGamesPlayed(){
            return gamesPlayed;
        public int getGamesWon(){
            return gamesWon;
        public boolean lastGameWon(){
            return lastGameWon;
        public int nextSum()
            dice1.roll();
            dice2.roll();
            return dice1.getSideUp() + dice2.getSideUp();
        public void play() {
            gamesPlayed++;
            firstRoll = nextSum();
            if (firstRoll == 7 || firstRoll == 11)
                gamesWon++;
                lastGameWon = true;
            else if (firstRoll == 2 || firstRoll == 3 || firstRoll == 12)
                lastGameWon = false;
            else
               secondRoll = nextSum();
               if (firstRoll == secondRoll)
                  gamesWon++;
                  lastGameWon = true;
               else
                  lastGameWon = false;
        public String toString()
            return "games - " + gamesPlayed + ", won - " + gamesWon + ", last game won - " + lastGameWon + " First Roll - " + firstRoll +
                    ", Second Roll - " + secondRoll;
    }I'm not sure of craps rules, the code above makes a first roll and if game isn't won or lose at once (7 and 11 wins, 2,3 or 12 lose) a second roll is done. If the second roll is equals to the first made then the game is won else the game is lose. Is it right?

  • How to put the break at the first place of execution While Loop

    Hello everybody,
    I have a problem with a while loop.
    I made the interface of a tic-tac-toe game with labview.
    my problem is that after the computer has won or there is a draw, that the board has to be updated, which i do by shift register.
    My problem is now though, that there isn't a break after i updated the board. I have to click one more time on the board(and execute the whole VI) before the break sets in.
    so my question is, how can i put the break in a way that the condition is checked everytime BEFORE the VI runs?
    Thank you very much

    The correct way is probably to use a state machine architecture. Simply enter the idle state when the game is over.
    LabVIEW Champion . Do more with less code and in less time .

  • Flash Player having problems while playing online games on OS X Mavericks

    i use mbp mid 2010 with os x mavericks 10.9.2 and while playing online games, it usually happens some freezes and delays. when i play same game with same browser on windows 7(bootcamp) there is no freeze and delay. i have made lots of search about this and made some optimizations on flash player settings but the problem continues. i use both chrome and firefox on both mavericks and win7 (bootcamp) but having the same problems on mavericks every time. the game is very slow with freeze and delays on mavericks. will adobe make a real effective upgrade about flash player for macs.

    Hmmm... Win 7 will run faster than Mavericks with 8Gb. Even my Vm of 7 runs faster once I get it past all the startup processes.
    It may or may not be a connectivity problen since Windows uses a different protocol, even though it's on the same hardware. Usually though, what affects OS X will affect BootCamp too.
    What browser?

  • Circular linked list while loop

    i have a circular linked list and i'd like a while loop to iterate though all of them. my problem is that it always excludes the last node. i know why, it's due to the fact that "current.next != alive" skips it from ever accessing the last node. i can't seem to solve it. note that the last node in the list points to the first node (alive):
                   while(current.next != alive )
                        prev = prev == null ? prev = alive : prev;
                        //identify the name with it's matching node
                        if(name.equals(current.name.toLowerCase()))
                             prev.next = current.next;
                             dead = current;
                             current = current.next;
                             dead.next = null;
                             while(dead.next != null)
                                  dead = dead.next;
                        else
                             prev = current;
                             current = current.next;     
                   }

    //this class assists the client in managing a game of assassinations. it does so by providing options such as verifying a target's existence, getting the list of dead people, getting the lsit of alive people, and moving people from the alive to dead list
    public class AssassinManager
         private AssassinNode alive;
         private AssassinNode alive_tail;
         private AssassinNode dead;
         //pre: must send a string array
         //post: nodes are created
         public AssassinManager(String[] names)
              dead = null;
              alive = new AssassinNode(names[0]);
              AssassinNode current = alive;
              System.out.println(names[0] + " is first, " + names[(names.length-1)] + " is last\n\n");
              for(int i = 1; i < names.length; i++)
                   while(current.next != null)
                        current = current.next;
                   current.next = new AssassinNode(names);
              alive_tail = current.next = new AssassinNode(names[(names.length - 1)], alive);
         //post: outputs all the people still alive
         public void printKillRing()
              AssassinNode last = null, current = alive;
              while(current.next!= alive)
                   System.out.println(current.name + " is stalking " + current.next.name);
                   last = current.next;
                   current = current.next;
              System.out.println(current.name + " is stalking " + alive.name);
         //post: outputs a list of the dead people
         public void printGraveyard()
              AssassinNode last = null, current = dead;
              while(dead != null)
                   System.out.println(current.name + " was killed by " + current.killer);
                   last = current.next;
                   current = current.next;
         //pre: must send a string name
         //post: will return true/false depending on the input if the name is in the killing ring (alive)
         public boolean killRingContains(String name)
              AssassinNode current = alive;
              name = name.toLowerCase();
              while(current.next!= alive)
                   if(name.equals(current.name.toLowerCase()))
                        return true;
                   current = current.next;
              return false;
         //pre; must send a string name
         //post: will return true/false if the name is in the graveyard list
         public boolean graveyardContains(String name)
              AssassinNode current = dead;
              name = name.toLowerCase();
              while(dead != null && current.next != null)
                   if(name.equals(current.name.toLowerCase()))
                        return true;
                   current = current.next;
              return false;
         //post: checks if game is over by seeing if there is more than 1 player
         public boolean gameOver()
              AssassinNode current = alive;
              if(current.next == null)
                   return true;
              return false;
         //post: outputs the winner's name
         public String winner()
              AssassinNode current = alive;
              if(current.next == null)
                   return alive.name;
              return null;
         //pre: must send a string name that exists is alive
         //post: will remove the user from the alive list and add it to the killed list
         public void kill(String name)
              //check if person exists to remove them from alive list
              if(killRingContains(name.trim()) == true)
                   AssassinNode prev = null, current = alive, dead = this.dead;
                   name = name.toLowerCase();
                   while(current != null)
                        System.out.println(current.name);
                        if(name.equals(current.name.toLowerCase()))
                             prev = prev == null ? alive_tail : prev;
                             prev.next = current.next;
                             //dead = dead == null ? current : dead;
                             //while(dead.next != null)
                                  //dead = dead.next;
                             if(prev.next == alive)
                                  break;
                             current = prev.next;
                        else
                             if(current.next == alive)
                                  break;
                             prev = current;
                             current = current.next;
    }Edited by: ixxalnxxi on Apr 27, 2008 12:58 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • SubVI with while loop + event structure not working in multi tab VI

    Hello Everyone,
    I am developing an interface for the control of a prober using Labview 2012, and I am stuck with some issue.
    To start with I provide you with a simplified version of my control interface VI, and with the sub-VI used to build and manage the wafer maps.
    The VI consists of several tabs: Prober Initialization, Wafer Handling, Wafer Map, Status, Error.
    The sub-VI can:
    1/ initialize the grid to display the map (sub VI Init Grid not provided here)
    2/ import XY coordinates from a txt file (sub VI Wafer Map Import)
    3/ display the coordinates and index of the die below the cursor
    4/ and when a die position is double clicked, and the boolean "Edit Wafer Map" is true, then the user can change the state (color) of the die between On-wafer die and Selected Die
    My issue:
    If I use the sub-VI by itself, it works fine. However when I use it as a sub-VI in the tab "Wafer Map", the map does not build up and I can no further use the embedded functionalities in the sub-VI.
    I suspect the while loop + event structure of the sub-VI to be the bottleneck here.
    However I don't know which way to go, that's why I'd be glad to have some advice and help here.
    Thank you.
    Florian
    Solved!
    Go to Solution.
    Attachments:
    Control Interface.zip ‏61 KB

    Hi NitzZ,
    Thank you for your reply.
    I tried to save the VIs in LV10, please tell me if you can open them now.
    Inside he event structure there is quite some code, and since I don't want to make the main vi too bulky, I would like to keep it as a sub-VI. 
    As you can see from the sub-VI, the event structure is used for extracting cursor position and tracking the double click action. These events are linked, through a property node, to the image "Wafer Map" which is passed to the main vi through connector pane.
    All values are passed this way as well (through connector pane). Is there another way?
    Maybe "refnum", but I don't really understand how to use them...
    If I use the event structure in the main vi, the wafer map is still not working. I tried it earlier.
    To implement the multi tab front panel, I used a tab control, and a for loop + case structure. For each element of the case structure, there is a corresponding action.
    For the case where I put the code (element=2) for Wafer Map, I also control the execution of the code with a case structure activated by the button "REFRESH". Otherwise I end up with a freezing of the panel right after the start.
    I hope these comments help you understand better.
    Regards,
    Florian
    Attachments:
    Control Interface.zip ‏104 KB

  • My MacBook Pro completely crashes while loading up games

    Hey all, thanks for reading.
    I'm running a MacBook Pro (<1 year old)
    Processor: 2.8GHz Intel Core 2 Duo
    RAM: 4GB 1067 MHz DDR3
    It's connected to the power supply, and it's set to High Performance (meaning the dedicated graphics card should be in use)
    Every time I try to play a game, my Mac completely freezes. I'm currently trying to play the Sims 3; hardly graphic-intensive. As soon as I click the Play button, the screen goes black and the disc drive starts to whirr (sometimes vibrating the computer violently). Then the animated EA logo swirls onto the screen, and the load music starts up. Before the EA logo can fully animate, my computer dies. The screen instantaneously goes black, and the background music keeps playing in a skipping fashion, like a broken record: click-click-click-click.
    Force Quit does nothing. None of the hardware buttons, e.g. volume/brightness controls, do anything. I have to hold down the power button to restart.
    It probably isn't overheating, since I've tried with my fans on full blast (smcFanControl) and I'm currently using a laptop cooling pad.
    I used to be able to play the Sims for a few hours before it would crash: it has gotten much worse. I downloaded the WoW demo and got a bit farther: I could create a character, but within 5 seconds of playing this same problem would happen.
    I know Macs aren't particularly good at playing games, but this seems a bit ridiculous. Can anyone help? I have the full error report saved, if that would be useful.
    Summary: While loading a game, my MacBook Pro full-crashes, becoming totally unresponsive, before the EA logo can even animate.

    Try it using the other (dedicated) graphics. Also, run your hardware tester.
    Check out the new remodeled MacOSG website! 24-hour Apple-related news & support.
     MacOSG: An Apple User Group  iTunes: MacOSG Podcast  Follow us on Twitter: MacOSG

  • Need help with while loops

    Hello let me first explain what im trying to achive:
    I want a moving square that you control with the arrow keys on the keyboard. It has to be smooth ie able to move fast without looking like its jumping and it has to be able to move diagonaly aswell. Think of that arcade game Raiden ...you know the birds-eye view plane flying game...another thing! I'd prefer if it didnt use timers - i made one already using 4 timers and it works great but 4 timers is a little extreme - SO NO TIMERS !
    I was thinking while loops, but i cant seem to get it working. I dont want to put in all the code so ill just say that I have 4 booleans: up, down, left right and the following code:
    public void keyPressed(KeyEvent e) {
    if (e.getKeyCode() == KeyEvent.VK_UP) {
    up = true;
    if (e.getKeyCode() == KeyEvent.VK_DOWN) {
    down = true;
    if (e.getKeyCode() == KeyEvent.VK_LEFT) {
    left = true;
    if (e.getKeyCode() == KeyEvent.VK_RIGHT) {
    right = true;
    repaint();
    For the KeyReleased part i have the same as above exept it sets the booleans to false.
    Soooo in theory if i set up a while loop like this (using the up direction as an example) :
    while (up == true) {
    [move square up]
    So therefore when i press and hold the up arrow the loop will keep going untill i realease it right? WRONG ! it just keeps repeating indefinatly and it doesnt even do the " [move square up] " bit. I put a System.out.print in the loop to test and it kept printing out the message but it still didnt do the actual " [move square up] " bit.
    Im not sure if im putting the while loop in the right place either....If anyone has any idea on how to use while loops in this way please heeeelp ! Its so annoying because it just doesnt work ive tried so many ways...
    any help would be greatly apreciated !!!!

    Maybe you want something like this? You have to pause during the loop to allow for other events to happen, like if y ou release a key or whatever.
    while( true )
       if( up ) moveUp();
       else if( down ) moveDown();
       if( left ) moveLeft();
       else if( right ) moveRight();
       try
          Thread.currentThread().sleep(10);
       catch( InterruptedException e )
          System.out.println( "Thread interrupted!");
    }

  • Firefox gets Stuck while Playing Facebook Games and Working in Another Tab

    Firefox gets stuck while playing facebook games (restaurant city) and side by side working in another tab or window of firefox. Switching between tabs takes time and on facebook scrolling doesn't remain smooth it gets stuck again and again while scrolling the page.
    Also, in earlier versions it was a great feature that when once a game is loaded then when i open it second time it was loaded immediately without any complete loading but now every time you play the same game it will load completely which happens generally when we reinstall firefox so that our saved cookies gets destroyed.
    ON THE OTHER HAND OPERA 10.6 LOADS FACEBOOK GAMES SMOOTHLY NO HANGS NO STUCKS NO FREEZES EVEN DOING OTHER WORK AND THE GAME ALSO LOADS IMMEDIATELY THE NEXT TIME WHEN IT IS OPENED.
    == This happened ==
    Every time Firefox opened
    == The 3.6 versions came up

    same things happen to me also the cache system is so slow it even download the flash player game after 3 or 4 days completely and hang is always the error when ever i use the fire fox also there is one more thing some time computer is not opening any site what ever u type mozilla is disconnected from IP what ever he issue is but if u close the firefox and start again it is working for a while after some time it may happen again time is not counted over this matter so i m sure this is the trouble from fire fox coz other browsers are working in the same time while mozila sucks

Maybe you are looking for