[Xperia Play Q&A, Help & Troubleshooting] DiamondBond:
[MENTION=4609488]wedgess[/MENTION] ,Sorry to bother u again but, I came across lots of errors when running the script in smanager... :/, Technically it should work fine

Anyway heres the raw code, Please can u help me fix it as its a good script but needs to work!, :D

Raw Code:

clear
echo "Pizza Engine Version 1.0 By Pizza_Dox"
sleep 1
echo "This will Fix Laggs in Games + Fix Your Ram Managements!"
sleep 1
echo "This will not increase FPs (but can do)"

sleep 2
echo "Checking for Root..."
if [ "$id" = "0" ] || [ "$id" = "root" ]; then
echo "Root permission: Yes, :)"
echo ""
else
echo "Root permission: No, :("
echo ""
echo "Please run the script with root permissions!"
sleep 2

echo "Checking for Busybox..."

if [ -e /sbin/busybox ]; then
echo "Busybox found!"
elif [ -e /system/xbin/busybox ]; then
echo "Busybox found!"
elif [ -e /system/bin/busybox ]; then
echo "Busybox found!"
else
echo "No busybox found, Please Install BusyBox"
fi

echo "Congrats, u passed the tests!, :D"
sleep 1
echo "mounting partitions for installation..."
sync; busybox mount -o remount,rw /
sync; busybox mount -o remount,rw rootfs
sync; busybox mount -o remount,rw /system
sleep 1
echo "done!"
clear
echo "Installation:"
echo "temporarily(t), permanently(p), uninstall(u), quit(q)"
echo "chose:"
read i
case "$i" in
t|T)
temp
;;
p|P)
perm
;;
u|U)
uninstall
;;
q|Q)
echo " "
echo "exiting... "
exit
;;
*)
echo " "
echo "user typed an invalid option, please try again. "
sleep 2
;;
esac
done
temp()
{
echo "comencing temporary installation!"
clear
sleep 2
echo " "
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo " "
sleep 2

#main vm tweaks
echo "Injecting main vm tweaks..."
sleep 1
if [ -e /proc/sys/vm/swappiness ]; then
echo "50" > /proc/sys/vm/swappiness
fi

if [ -e /proc/sys/vm/vfs_cache_pressure ]; then
echo "10" > /proc/sys/vm/vfs_cache_pressure
fi

if [ -e /proc/sys/vm/dirty_expire_centisecs ]; then
echo "500" > /proc/sys/vm/dirty_expire_centisecs
fi

if [ -e /proc/sys/vm/dirty_writeback_centisecs ]; then
echo "1000" > /proc/sys/vm/dirty_writeback_centisecs
fi

if [ -e /proc/sys/vm/dirty_ratio ]; then
echo "90" > /proc/sys/vm/dirty_ratio
fi

if [ -e /proc/sys/vm/dirty_background_ratio ]; then
echo "5" > /proc/sys/vm/dirty_background_ratio
fi
sleep 4
echo "-done!"

#misc vm tweaks
echo "Injecting misc vm tweaks..."
sleep 1
if [ -e /proc/sys/vm/page-cluster ]; then
echo "3" > /proc/sys/vm/page-cluster
fi

if [ -e /proc/sys/vm/min_free_kbytes ]; then
echo "4096" > /proc/sys/vm/min_free_kbytes
fi

if [ -e /proc/sys/vm/min_free_order_shift ]; then
echo "4" > / proc/sys/vm/min_free_order_shift
fi

if [ -e /proc/sys/vm/oom_kill_allocating_task ]; then
echo "1" > /proc/sys/vm/oom_kill_allocating_task
fi

if [ -e /proc/sys/vm/oom_dump_tasks ]; then
echo "1" > /proc/sys/vm/oom_dump_tasks
fi

if [ -e /proc/sys/vm/laptop_mode ]; then
echo "0" > /proc/sys/vm/laptop_mode
fi

if [ -e /proc/sys/vm/block_dump ]; then
echo "0" > /proc/sys/vm/block_dump
fi
sleep 4
echo "-done!"

#kernel tweaks to prevent crashes
echo "applying kernel tweaks to prevent random reboots..."
sleep 1
if [ -e /proc/sys/vm/panic_on_oom ]; then
echo "0" > /proc/sys/vm/panic_on_oom
fi

if [ -e /proc/sys/kernel/panic ]; then
echo "0" > /proc/sys/vm/panic
fi

if [ -e /proc/sys/kernel/panic_on_oops ]; then
echo "0" > /proc/sys/vm/panic_on_oops
fi
sleep 6
echo "-done!"

#tweaking lmk
echo "injecting lmk values..."
sleep 1
if [ -e /sys/module/lowmemorykiller/parameters/adj ]; then
echo "0,1,3,5,7,15" > /sys/module/lowmemorykiller/parameters/adj
fi

if [ -e /sys/module/lowmemorykiller/parameters/minfree ]; then
echo "2048,4096,10240,12032,14080,16384" > /sys/module/lowmemorykiller/parameters/minfree
fi
sleep 1
echo "-done!"

#memory reading speed tweaks
echo "tweaking memory read speed..."
sleep 1
echo 10 > /proc/sys/fs/lease-break-time
echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb
sleep 3
echo "-done!"

echo " "
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo " "
sleep 2

echo " "
echo "this script will now wait 8 seconds for all..."
echo "tweaks to stick!"
sleep 8
echo " "
echo "your caches will now be droped..."
sleep 2

#Adrenaline Boost V3 - Simplified
#Brought To You By Imbawind@XDA Developers
echo "droping caches..."
echo 3 > /proc/sys/vm/drop_caches
echo 1 > /proc/sys/vm/drop_caches
sleep 1
echo "done!"
sleep 1

echo " "
echo "Error 404 - Your Lagg is Gone!"
sleep 2
echo ":D"
sleep 1
echo "if this script speeds up your device slap..."
echo "that thanks button!"
sleep 1
echo "Done!"
echo "would you like to restart?(y/n): "
read i
case "$i" in
y|Y)
sleep 2
clear
echo "restarting... "
reboot
;;
n|N)
echo " "
echo " canceled."
sleep 2
main
;;
*)
echo " "
echo "invalid option, try again!"
sleep 2
;;
esac
done}

perm()
{
if [ -e /system/etc/init.d/* ]; then
fi
echo "caution, init.d files detected, make sure u removed all..."
echo "ram and vm realated managements or this will not work properly!"
echo "comencing permanent installation!"
clear
sleep 2
echo " "
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo " "
sleep 2

#main vm tweaks
echo "Injecting main vm tweaks..."
sleep 1
echo "echo "50" > /proc/sys/vm/swappiness" > system/etc/init.d/76pizzaengine
echo "echo "10" > /proc/sys/vm/vfs_cache_pressure" >> system/etc/init.d/76pizzaengine
echo "echo "500" > /proc/sys/vm/dirty_expire_centisecs" >> system/etc/init.d/76pizzaengine
echo "echo "1000" > /proc/sys/vm/dirty_writeback_centisecs" >> system/etc/init.d/76pizzaengine
echo "echo "90" > /proc/sys/vm/dirty_ratio" >> system/etc/init.d/76pizzaengine
echo "echo "5" > /proc/sys/vm/dirty_background_ratio" >> system/etc/init.d/76pizzaengine
sleep 4
echo "-done!"

#misc vm tweaks
echo "Injecting misc vm tweaks..."
sleep 1
echo "echo "3" > /proc/sys/vm/page-cluster" >> system/etc/init.d/76pizzaengine
echo "echo "4096" > /proc/sys/vm/min_free_kbytes" >> system/etc/init.d/76pizzaengine
echo "echo "4" > / proc/sys/vm/min_free_order_shift" >> system/etc/init.d/76pizzaengine
echo "echo "1" > /proc/sys/vm/oom_kill_allocating_task" >> system/etc/init.d/76pizzaengine
echo "echo "1" > /proc/sys/vm/oom_dump_tasks" >> system/etc/init.d/76pizzaengine
echo "echo "0" > /proc/sys/vm/laptop_mode" >> system/etc/init.d/76pizzaengine
echo "echo "0" > /proc/sys/vm/block_dump" >> system/etc/init.d/76pizzaengine
sleep 4
echo "-done!"

#kernel tweaks to prevent crashes
echo "applying kernel tweaks to prevent random reboots..."
sleep 1
echo "echo "0" > /proc/sys/vm/panic_on_oom" >> system/etc/init.d/76pizzaengine
echo "echo "0" > /proc/sys/vm/panic" >> system/etc/init.d/76pizzaengine
echo "echo "0" > /proc/sys/vm/panic_on_oops" >> system/etc/init.d/76pizzaengine
sleep 6
echo "-done!"

#tweaking lmk
echo "injecting lmk values..."
sleep 1
echo "echo "0,1,3,5,7,15" > /sys/module/lowmemorykiller/parameters/adj" >> system/etc/init.d/76pizzaengine
echo "echo "2048,4096,10240,12032,14080,16384" > /sys/module/lowmemorykiller/parameters/minfree" >> system/etc/init.d/76pizzaengine
sleep 1
echo "-done!"

#memory reading speed tweaks
echo "tweaking memory read speed..."
sleep 1
echo "echo 10 > /proc/sys/fs/lease-break-time" >> system/etc/init.d/76pizzaengine
echo "echo 2048 > /sys/devices/virtual/bdi/179:0/read_ahead_kb" >> system/etc/init.d/76pizzaengine
sleep 2
echo "-done!"

echo " "
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo " "

echo " "
echo "Error 404 - Your Lagg is Gone!"
sleep 2
echo ":D"
sleep 2
echo "if this script speeds up your device slap..."
echo "that thanks button!"
sleep 1
echo "Done!"
echo "would you like to restart?(y/n): "
read i
case "$i" in
y|Y)
sleep 2
clear
echo "restarting... "
reboot
;;
n|N)
echo " "
echo " canceled."
sleep 2
main
;;
*)
echo " "
echo "invalid option, try again!"
sleep 2
;;
esac
done}

uninstall()
{
echo "uninstalling, :("
clear
sleep 2
echo " "
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo " "
sleep 2

#uninstaller
echo "removing..."
rm system/etc/init.d/76pizzaengine 2>/dev/null
sleep 1

echo " "
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo -n " ===="
sleep 1
echo " "

echo " "
echo "Your Lagg has Come Back"
sleep 2
echo ":("
sleep 1
echo "Done!"
echo "would you like to restart?(y/n): "
read i
case "$i" in
y|Y)
sleep 2
clear
echo "restarting... "
reboot
;;
n|N)
echo " "
echo " canceled."
sleep 2
main
;;
*)
echo " "
echo "invalid option, try again!"
sleep 2
;;
esac
done}