17th Jul, 2008

Facebook 古惑仔 Online 自動存錢機 Version 1.0

要等 50 個 comment 可能仲有排, 而家放住個自動存錢機俾大家, 釣下大家癮先。

如果未 setup Firefox 同 greasemonkey, 就先去依度睇睇:

攪掂左之後, 就去 right click 個 greasemonkey, 然後 click new user script

如果你係第一次用, 佢會問你 default editor 用邊款, 一般黎講如果係 Windows, 用筆記本(Notepad) 就得, 位置通常喺 C:\Windows。 攪掂之後就會叫你入野:

Name 填 auto bank-in, Includes 填 http://apps.facebook.com/street-wars/bank.php, 其他亂嚟就得。 Click OK 之後佢就會開個筆記本(Notepad)出黎, 之後將以下編程抄落去就得:

// ==UserScript==
// @name           auto bank-in
// @namespace      hk.orz
// @include        http://apps.facebook.com/street-wars/*
// @description    by neo@orz.hk, please visit http://orz.hk
// ==/UserScript==
 
var last_load = new Date();
 
// setup a count down box
var htmlElement = document.createElement('div');
htmlElement.id = 'timer';
htmlElement.style.color = 'white';
htmlElement.style.position = 'fixed';
htmlElement.style.width = '50px';
htmlElement.style.height = '20px';
htmlElement.style.textAlign = 'center';
htmlElement.style.paddingTop = '4px';
htmlElement.style.paddingTop = '2px';
htmlElement.innerHTML = 'start';
window.parent.document.body.appendChild(htmlElement);
 
window.setTimeout(function() { tick() }, 1);
 
function tick() {
  current = new Date();
  minutes = (current - last_load) / 1000 / 60;
 
  // click the deposit button if there is money to save
  if (document.getElementsByName("amount").length > 1)
    if (document.getElementsByName("amount")[1].value != '0')
	document.getElementsByName("deposit")[0].click();
 
  // display the minute
  htmlElement.innerHTML = minutes ;
 
  // we only refresh in first/last 5 minutes of an hour, as it is the revenue clearance period
  if (current.getMinutes() < 5 || current.getMinutes() > 55) {
     htmlElement.style.background = 'red';
     // check every 3 minute
     if (minutes > 3) {
        location.href='http://apps.facebook.com/street-wars/bank.php';
     }
  } else {
     htmlElement.style.background = 'green';
  }
 
  // come back again every 10 seconds
  window.setTimeout(function() { tick()}, 10000);
}

儲存完之後可以關閉個筆記本, 之後就去銀行:

http://apps.facebook.com/street-wars/bank.php

咁你就會見到facebook 左上角有個綠色或者紅色嘅 Box 喺度倒數。 見到即喺段script 正常運作, 只要依一頁唔 close, 段 script 就會每十秒 run 一次, 完成自動存錢。

因為通常收入大約搭正先結算, 所以大約嗰個時間先每隔 3分鐘 reload 頁面內容, 咁個 box就會顯示紅色; 平時就顯示綠色。如果發現個存款位置唔係 0 , 即係有錢可以存入銀行啦, 咁就會自動 click 個存錢button。

今次一定會等依個 post 夠 50個 comments 先再出自動做任務, 哈哈!

From Billy:

溫提:可以直接paste落notepad
改名做anyname.user.js
拖落firefox就用得

分享這編文章:
  • Facebook
  • Twitter
  • Digg
  • del.icio.us
  • Yahoo! Buzz
  • StumbleUpon

相關文章

回應

“咁你就會見到facebook 左上角有個綠色或者紅色嘅 Box 喺度倒數。”

我冇lee個><

john titor on 2008-07-18 07:47

再一次嚴重支持…
50個comments 係咪將有關o既3個post 加埋 ^.^

supertvb on 2008-07-18 10:22

我入左個自動 bank in
好似要手動入左”主頁” 先 refresh 到個銀碼
再入番 銀行果頁先自動 save 既 ><

午餐肉 on 2008-07-18 13:07

我都見唔到個box.. 我用緊Firefox 3.0

Siu Ming on 2008-07-18 15:21

如果冇個box 既話, 可能係段 script 有問題, 可以去工具(Tools)入面既 Error Console 睇下有冇相關既錯誤訊息, post 返出黎睇下。

另一個可能係設定錯誤, 如果想知係唔係, 可以喺
var last_load = new Date();
之前加句 alert(‘running’);
重新入銀行嗰頁之後, 若果你唔見有個 message box ‘running’ 彈出黎既話, 即係 greasemonkey 唔知段 script 要喺銀行嗰頁行。咁就要喺 Manage User Scripts 入面加返 http://apps.facebook.com/street-wars/bank.php 入 include page。

腦功仔 on 2008-07-18 15:32

> 我入左個自動 bank in
> 好似要手動入左”主頁” 先 refresh 到個銀碼
> 再入番 銀行果頁先自動 save 既 ><

依個情況有時我都試過, 可能係 cache 問題, 我而家調節緊

腦功仔 on 2008-07-18 15:33

我試下自己加返d alert debug 先, 我見個Error Console 話有Missing ‘)’ in the if statement.

Siu Ming on 2008-07-18 16:14

我知做乜事了.. HAHAA, 個If statement, 我要轉返個 Greater-than symbol 先得.

Siu Ming on 2008-07-18 16:32

行得郁了, 見到個Green Box. 等時間過先. or 我自己改下個script.

Siu Ming on 2008-07-18 16:43

咦係喎, 個 editor 幫我轉晒, 而家 ok 了, thanks!

腦功仔 on 2008-07-18 17:52

好好既支援服務 XDDDD

午餐肉 on 2008-07-18 23:52

多得大家提意見

腦功仔 on 2008-07-19 00:02

^0^ 非常正的~~~~

儲錢快多了~~~

THX~~~

gvry on 2008-07-19 11:06

gvry 你咁高級, 又多疊友, 哈哈。
我而家就黎 22級, 但係唔夠疊友, 差唔多長期俾人打, 所以加密左檢查現金密度

腦功仔 on 2008-07-19 12:38

Good!!!!!support!!!

Kit on 2008-07-19 14:43

GOOD~ I HOPE

HOHO~ on 2008-07-19 14:46

快0的有自動外掛就好了~

ivy on 2008-07-19 14:47

support 自動做任務 ^.^

Egg on 2008-07-22 12:23

if (document.getElementsByName(“amount”)[1].value != ’0′)
呢句似乎乎要改改…因為如果少過 $100, 佢係唔俾入錢,但係因為有錢,會令到個 script 不停 submit

Rocky on 2008-08-03 17:42

bingo, 新版本解決咗依個問題

腦功仔 on 2008-08-04 10:49

近日發現少部份玩家使用robot進行遊戲,影響遊戲的公平性。

在此,我們呼籲各位不要使用任何形式的外掛或robot。一經發現,將會暫時停止該玩家進入遊戲24小時,嚴重者將刪除該玩家的所有遊戲記錄。

wt can we do?

terreo on 2008-08-06 20:10

成功了,真係好好用

William Chan on 2008-08-07 00:39

無法啟動編輯器
[Exception... "Component returned failure code: 0x80520003 (NS_ERROR_FILE_EXECUTION_FAILED) [nsIProcess.run]” nsresult: “0×80520003 (NS_ERROR_FILE_EXECUTION_FAILED)” location: “JS frame :: chrome://greasemonkey/content/utils.js :: launchApplicationWithDoc :: line 188″ data: no]

what can i do

haha on 2008-08-08 01:18

搞左好耐都唔得…

miko on 2008-08-08 23:24

無法啟動編輯器= =

阿雪 on 2008-08-15 19:41

錯誤: uncaught exception:
P
³å|ë method Location.toString

what’s that =.=?

Sam on 2008-08-16 19:50

有個box者係得
but我冇..

john on 2008-08-18 12:03

facebook 個新介面唔 work 喎。你轉返舊介面試下。

真正 john on 2008-08-18 13:57

佢轉番我去新介面

john on 2008-08-18 21:37

不如搵人整個打包板
將firefox加左自動入錢同任務理埋一齊俾人down
正@@

john on 2008-08-18 21:40

唔駛咁大陣象吧, 用 C# 寫個 .NET Application 仲好。 況且而家都少左人玩, 沒甚價值。

腦功仔 on 2008-08-18 23:37

我自己將 neo 個自動入錢同任務機合併左喎。如果 neo 兄不介意我可以貼出黎。

真正 john on 2008-08-19 07:24

當然不介意, 代其他網友多謝你

腦功仔 on 2008-08-19 08:59

// ==UserScript==
// @name auto-mission
// @namespace hk.orz
// @description by neo@orz.hk, please visit http://orz.hk
// @include http://apps.facebook.com/street-wars/job.php
// @include http://apps.facebook.com/street-wars/bank.php
// Version 1.0
// ==/UserScript==

/*
Function:
- check strength and gold every loading and in 5 minutes. if you have strength, auto run the default job.
- if you have over $100 cash, auto throw them in the bank

Known problem:
- may stop at “Try again” error message when the game is busy at night
- does not work with Facebook new user interface

What you should know about the game:
- when you want to get cash from bank, disable greasemoney first, or your money will go back to the bank with 10% cut off.
- if you do not have enough strength, a job won’t run
- if you do not have ALL the required equipment, a job won’t run
- if you do not meet the level / buddy requirement, a job won’t run
- you generate 5 health, 1 strength, and 1 mind every 5 minutes
- the hourly pay always take place at 0 minutes every hour, if your computer clock syn with the world clock
- if you use this script and got banned, don’t blame us
*/

// Things you can change
//———————————————————————————————
// 工作代號,可選: 1 至 9. job 5 是走水貨
const jobid = 5; //<- 改這個的話,記得改埋體力要求.
// 該工作最低體力要求. if you have this wrong the script will fail to work
// – job 5 need 10, job 6 need 15, job 7 need 18, job 8 need 25, etc…
const needstrength = 10; //
//———————————————————————————————

var last_check = new Date();
var check_time = (last_check.getMinutes() % 5)

// setup a count down box
var htmlElement = document.createElement(‘div’);
htmlElement.id = ‘neotimer’;
htmlElement.style.font = “11px arial”
htmlElement.style.color = ‘black’;
htmlElement.style.Top = ’3px’;
htmlElement.style.Left = ’2px’;
htmlElement.style.position = ‘absolute’;
htmlElement.style.width = ’200px’;
htmlElement.style.height = ’42px’;
htmlElement.style.paddingTop = ’3px’;
htmlElement.style.paddingLeft = ’2px’;
htmlElement.style.background = ‘#CCFFCC’;
htmlElement.style.zIndex = 100;
window.parent.document.body.appendChild(htmlElement);

// start up check
window.setTimeout(function() { tick() }, 300);

function check_and_run() {
// check strength
health_tag = document.getElementById(‘app17326627347_main’);
if ( health_tag == null) return;
str = (new RegExp(‘體力:[^<]+’)).exec(health_tag.innerHTML);
if (str == null) return null;
health = parseInt(str.toString().split(‘:’)[1].split(‘/’)[0]);
if (health < needstrength) return health;
action = document.getElementById(‘app17326627347_mod_action-’ + jobid);
if (action == null) return health;
action_link = action.getElementsByTagName(‘a’)[0];
if (action_link == null) return health;

// click
GM_setValue(‘reload’, 1);
var evt = document.createEvent(“MouseEvents”);
evt.initMouseEvent(“click”, true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);
action_link.dispatchEvent(evt);
return health;
}

function check_money() {
// check money
money_tag = document.getElementById(‘app17326627347_main’);
if ( money_tag == null) return;
str = (new RegExp(‘現金:[^v]+’)).exec(money_tag.innerHTML);
if (str == null) return null;
money = parseInt(str.toString().split(‘$’)[1].split(‘<’)[0].replace(/,/,”"));
if (money < 101) return money;
if (location.href!=’http://apps.facebook.com/street-wars/bank.php’)
location.href=’http://apps.facebook.com/street-wars/bank.php’;
return money;
}

function tick() {
current = new Date();
seconds = (current – last_check) / 1000;
health = check_and_run();
money = check_money();

// display
htmlElement.innerHTML = ‘古惑自動做嘢 + 銀行機 v1.2 by neo@orz.hk (merged by john)’
htmlElement.innerHTML += ‘Time: ‘ + current.getHours()
htmlElement.innerHTML += ‘:’ + checkTime(current.getMinutes()) + ‘:’ + checkTime(current.getSeconds());
if (health != null)
htmlElement.innerHTML += ‘   體力: ‘ + health;
if (money != null)
htmlElement.innerHTML += ‘   現金: ‘ + money;

// reload on error
if (document.getElementById(‘error_message’) != null) {
GM_setValue(‘reload’, 0);
location.href=’http://apps.facebook.com/street-wars/job.php’;
return;
}

// reload if a job ran
if (GM_getValue(‘reload’) == 1) {
GM_setValue(‘reload’, 0);
location.href=’http://apps.facebook.com/street-wars/job.php’;
return;
}

// reload every 10 minutes, so that hourly income will save to bank and reset the script from error
if (((current.getMinutes() % 5) == check_time ) && (current.getSeconds() 1) {
if (parseInt(document.getElementsByName(“amount”)[1].value) > 100) {
document.getElementsByName(“deposit”)[0].click();
return;
} else {
GM_setValue(‘reload’, 0);
location.href=’http://apps.facebook.com/street-wars/job.php’;
return;
}
} else {
GM_setValue(‘reload’, 0);
location.href=’http://apps.facebook.com/street-wars/job.php’;
return;
}

// come back again every second, looks cool
window.setTimeout(function() { tick()}, 1037);
}

function checkTime(i) {
if (i<10) i=”0″ + i;
return i;
}

真正 john on 2008-08-19 11:17

上面個 script 的 current.getseconds() 之後個細過等於 好似冇左

真正 john on 2008-08-19 11:37

我已經將段 javascript 放左係:
http://orz.hk/2008/08/19/2608/

同埋加個 <=

thx

腦功仔 on 2008-08-19 12:25

I think you used word to update the file, which changed all quotation marks to the windows quotation marks.

I have sent you an email with the script zipped. I hope it helps everyone. =)

真正 john on 2008-08-19 13:28

thx, updated in
http://orz.hk/2008/08/19/2608/

腦功仔 on 2008-08-19 13:56

你的回應






Your response: