Advertisement
Guest User

gw2cores

a guest
Dec 11th, 2012
830
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.85 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. sleep 15
  4.  
  5. OLDPID='a'
  6.  
  7. while true; do  #check if gw2 is running
  8.  
  9.         GW2PID=`ps -A | grep -m 1 'Gw2' | awk '{print $1}'`
  10.         WINESVRPID=`ps -A | grep -m 1 'wineserver' | awk '{print $1}'`
  11.         WINEDEVPID=`ps -A | grep -m 1 'winedevice.exe' | awk '{print $1}'`
  12.  
  13.         if [ ! $GW2PID ]; then
  14.                 echo 'Guild Wars 2 is not running'
  15.         echo 'Processor is downgrading'
  16.     elif [ $OLDPID != $GW2PID ]; then
  17.             echo 'Guild Wars 2 is getting tuned'
  18.                     OLDPID=$GW2PID
  19.                     taskset -pc 0-3 $WINESVRPID #set to use core 0 to 3 ( quadcore )
  20.                     taskset -pc 0-3 $WINEDEVPID
  21.                     taskset -pc 0-3 $GW2PID
  22.             echo 'Processor is optimizing'
  23.             cpufreq &
  24.             exit    #ends the script
  25.             else
  26.                     echo 'Guild Wars 2 is already tuned.'
  27.     fi
  28.         sleep 15
  29. done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement