最新程序开发语言,你要的国产编程语言CBrother来了
最新程序开发语言,你要的国产编程语言CBrother来了
简单的桌面创建创建app.cb
import lib/windows/CustomWindow
//窗口基类
class App extends CustomWindow
{
//结构函数
function App(config)
{
//创建窗口
var title= config.get("title");
var width = config.get("width");
var height = config.get("height");
var left = config.get("left"); //窗口距离左边距离
var top = config.get("top"); //窗口右边距离
super(title);
//创建窗口函数
createWindow(title (WS_OVERLAPPEDWINDOW ^ WS_THICKFRAME & ~WS_MAXIMIZEBOX) | WS_CLIPSIBLINGS | WS_POPUP left top width height null);
}
//运行窗口
function run()
{
super.run(); //调用基类窗口运行
}
}
function main(parm)
{
var config = {"title":"演示窗口" "width":500 "height":300 "left":248 "top":"100" "WindowState":"fullscreen" "BackgroundColor":"#000"};
var app = new App(config);
app.createButtom("提交" 5 185 60 60 7);
app.createStaticText("hello world" 10 10 150 20);
app.createEditBox(150 10 100 20);
app.run();
}
命令行启动:
执行效果:
LOL 工具import lib/windows/CustomWindow
class LolToolsWin extends CustomWindow
{
var m_ZoneIDComboBox = null;
var m_GameModeComboBox = null;
var m_QQEditBox = null;
var m_PlayerIDEditBox = null;
var m_PlayerNameEditBox = null;
var m_RankComboBox = null;
var m_Team1ID = new Array();
var m_Team1Name = new Array();
var m_Team2ID = new Array();
var m_Team2Name = new Array();
//var
var m_WinCheckBox = null;
var m_GradeComboBox = null;
var m_GameIDEditBox = null;
var m_PathEditBox = null;
var m_killcntEditBox = null;
var m_assistsEditBox = null;
var m_deathsEditBox = null;
var m_killspreeEditBox = null;
var m_killmulEditBox = null;
var m_GoldEditBox = null;
var m_minionskillEditBox = null;
var m_ZoneID = [257 513 769 1025 1281 1537 1793 2049 2305 2561 2817 3073 3329 3585 3841 4097 4353
4609 4865 258 514 770 1026 1282 1538 1794 65539 261];
var m_GameMode = ["CLASSIC" "CLASSIC" "ARAM" "TFT"];
var m_QueueType = ["NORMAL" "" "" ""];
var m_RankName = ["" "iron" "bronze" "silver" "gold" "platinum" "diamond" "master" "grandmaster" "challenger"];
function LolToolsWin()
{
super("loltoolswin");
setBackground(COLOR_WINDOW);
setIcon(GetRoot() "\\11_2.ico");
createWindow("LOL战绩伪造工具"
(WS_OVERLAPPEDWINDOW ^ WS_THICKFRAME & ~WS_MAXIMIZEBOX) | WS_CLIPSIBLINGS | WS_POPUP
400 200 860 510 null);
//var a = -1798569908;
//createWindow("loltoolswin" a 400 200 272 480 null);
}
function onCreate()
{
this.createStaticText("大区:" 10 30 70 20);
m_ZoneIDComboBox = this.createComboBox(90 30 140 200);
m_ZoneIDComboBox.addString("艾欧尼亚");
m_ZoneIDComboBox.addString("祖安");
m_ZoneIDComboBox.addString("诺克萨斯");
m_ZoneIDComboBox.addString("班德尔城");
m_ZoneIDComboBox.addString("皮尔特沃夫");
m_ZoneIDComboBox.addString("战争学院");
m_ZoneIDComboBox.addString("巨神峰");
m_ZoneIDComboBox.addString("雷瑟守备");
m_ZoneIDComboBox.addString("裁决之地");
m_ZoneIDComboBox.addString("黑色玫瑰");
m_ZoneIDComboBox.addString("暗影岛");
m_ZoneIDComboBox.addString("钢铁烈阳");
m_ZoneIDComboBox.addString("水晶之痕");
m_ZoneIDComboBox.addString("均衡教派");
m_ZoneIDComboBox.addString("影流");
m_ZoneIDComboBox.addString("守望之海");
m_ZoneIDComboBox.addString("征服之海");
m_ZoneIDComboBox.addString("卡拉曼达");
m_ZoneIDComboBox.addString("皮城警备");
m_ZoneIDComboBox.addString("比尔吉沃特");
m_ZoneIDComboBox.addString("德玛西亚");
m_ZoneIDComboBox.addString("弗雷尔卓德");
m_ZoneIDComboBox.addString("无畏先锋");
m_ZoneIDComboBox.addString("恕瑞玛");
m_ZoneIDComboBox.addString("扭曲丛林");
m_ZoneIDComboBox.addString("巨龙之巢");
m_ZoneIDComboBox.addString("教育网专区");
m_ZoneIDComboBox.addString("男爵领域");
m_ZoneIDComboBox.setCurSel(0);
this.createStaticText("Q Q:" 10 70 70 30);
m_QQEditBox = this.createEditBox(90 70 135 28);
this.createStaticText("PlayerID:" 10 110 70 30);
m_PlayerIDEditBox = this.createEditBox(90 110 135 28);
this.createStaticText("Name:" 10 150 70 30);
m_PlayerNameEditBox = this.createEditBox(90 150 135 28);
this.createStaticText("段位:" 10 190 70 30);
m_RankComboBox = this.createComboBox(90 190 140 300);
m_RankComboBox.addString("无");
m_RankComboBox.addString("黑铁");
m_RankComboBox.addString("青铜");
m_RankComboBox.addString("白银");
m_RankComboBox.addString("黄金");
m_RankComboBox.addString("铂金");
m_RankComboBox.addString("钻石");
m_RankComboBox.addString("超凡大师");
m_RankComboBox.addString("傲视宗师");
m_RankComboBox.addString("最强王者");
m_RankComboBox.setCurSel(0);
this.createStaticText("模式:" 10 230 70 30);
m_GameModeComboBox = this.createComboBox(90 230 140 150);
m_GameModeComboBox.addString("匹配");
m_GameModeComboBox.addString("排位");
m_GameModeComboBox.addString("大乱斗");
m_GameModeComboBox.addString("云顶之弈");
m_GameModeComboBox.setCurSel(0);
this.createStaticText("GameID:" 10 270 70 30);
m_GameIDEditBox = this.createEditBox(90 270 135 28);
this.createGroupBox("队伍1" 400 5 440 210);
this.createStaticText("ID1:" 410 30 40 30);
m_Team1ID.add(this.createEditBox(455 30 150 28));
this.createStaticText("名字1:" 610 30 60 30);
m_Team1Name.add(this.createEditBox(675 30 150 28));
this.createStaticText("ID2:" 410 65 40 30);
m_Team1ID.add(this.createEditBox(455 65 150 28));
this.createStaticText("名字2:" 610 65 60 30);
m_Team1Name.add(this.createEditBox(675 65 150 28));
this.createStaticText("ID3:" 410 100 40 30);
m_Team1ID.add(this.createEditBox(455 100 150 28));
this.createStaticText("名字3:" 610 100 60 30);
m_Team1Name.add(this.createEditBox(675 100 150 28));
this.createStaticText("ID4:" 410 135 40 30);
m_Team1ID.add(this.createEditBox(455 135 150 28));
this.createStaticText("名字4:" 610 135 60 30);
m_Team1Name.add(this.createEditBox(675 135 150 28));
this.createStaticText("ID5:" 410 170 40 30);
m_Team1ID.add(this.createEditBox(455 170 150 28));
this.createStaticText("名字5:" 610 170 60 30);
m_Team1Name.add(this.createEditBox(675 170 150 28));
this.createGroupBox("队伍2" 400 220 430 210);
this.createStaticText("ID1:" 410 245 40 30);
m_Team2ID.add(this.createEditBox(455 245 150 28));
this.createStaticText("名字1:" 610 245 60 30);
m_Team2Name.add(this.createEditBox(675 245 150 28));
this.createStaticText("ID2:" 410 280 40 30);
m_Team2ID.add(this.createEditBox(455 280 150 28));
this.createStaticText("名字2:" 610 280 60 30);
m_Team2Name.add(this.createEditBox(675 280 150 28));
this.createStaticText("ID3:" 410 315 40 30);
m_Team2ID.add(this.createEditBox(455 315 150 28));
this.createStaticText("名字3:" 610 315 60 30);
m_Team2Name.add(this.createEditBox(675 315 150 28));
this.createStaticText("ID4:" 410 350 40 30);
m_Team2ID.add(this.createEditBox(455 350 150 28));
this.createStaticText("名字4:" 610 350 60 30);
m_Team2Name.add(this.createEditBox(675 350 150 28));
this.createStaticText("ID5:" 410 385 40 30);
m_Team2ID.add(this.createEditBox(455 385 150 28));
this.createStaticText("名字5:" 610 385 60 30);
m_Team2Name.add(this.createEditBox(675 385 150 28));
this.createGroupBox("战斗数据" 240 5 150 350);
this.createStaticText("击杀:" 245 30 50 30);
m_killcntEditBox = this.createEditBox(300 30 75 28);
this.createStaticText("助攻:" 245 65 50 30);
m_assistsEditBox = this.createEditBox(300 65 75 28);
this.createStaticText("死亡:" 245 100 50 30);
m_deathsEditBox = this.createEditBox(300 100 75 28);
this.createStaticText("连杀:" 245 135 50 30);
m_killspreeEditBox = this.createEditBox(300 135 75 28);
this.createStaticText("多杀:" 245 170 50 30);
m_killmulEditBox = this.createEditBox(300 170 75 28);
this.createStaticText("金币:" 245 205 50 30);
m_GoldEditBox = this.createEditBox(300 205 75 28);
this.createStaticText("补兵:" 245 240 50 30);
m_minionskillEditBox = this.createEditBox(300 240 75 28);
this.createStaticText("评分:" 245 275 50 30);
m_GradeComboBox = this.createComboBox(300 275 75 150);
m_GradeComboBox.addString("无");
m_GradeComboBox.addString("S ");
m_GradeComboBox.addString("S");
m_GradeComboBox.addString("S-");
m_GradeComboBox.addString("A ");
m_GradeComboBox.addString("A");
m_GradeComboBox.addString("A-");
m_GradeComboBox.addString("B ");
m_GradeComboBox.addString("B");
m_GradeComboBox.addString("B-");
m_GradeComboBox.addString("C ");
m_GradeComboBox.addString("C");
m_GradeComboBox.addString("C-");
m_GradeComboBox.addString("D ");
m_GradeComboBox.addString("D");
m_GradeComboBox.addString("D-");
m_GradeComboBox.setCurSel(0);
this.createStaticText("胜:" 245 310 50 30);
m_WinCheckBox = this.createCheckBox("" 300 310 75 30);
this.createButtom("登录" 20 380 110 50 1);
this.createButtom("开始" 150 380 110 50 2);
this.createButtom("结束" 280 380 110 50 3);
this.createStaticText("生成路径:" 10 440 100 30);
m_PathEditBox = this.createEditBox(120 440 650 28);
Init();
}
function onCommand(cmdid)
{
if (cmdid == 1)
{
onLogin();
}
else if (cmdid == 2)
{
onGameBegin();
}
else if (cmdid == 3)
{
onGameEnd();
}
}
function onLogin()
{
Save();
var path = m_PathEditBox.getWindowText();
if (strlen(path) <= 0)
{
MessageBox(m_hWnd "没有配置路径" "错误" MB_OK | MB_ICONERROR);
return;
}
var QQ = m_QQEditBox.getWindowText();
if (strlen(QQ) <= 0)
{
MessageBox(m_hWnd "没有配置QQ号" "错误" MB_OK | MB_ICONERROR);
return;
}
var playerId = m_PlayerIDEditBox.getWindowText();
if (strlen(playerId) <= 0)
{
MessageBox(m_hWnd "没有配置PlayerID" "错误" MB_OK | MB_ICONERROR);
return;
}
var name = m_PlayerNameEditBox.getWindowText();
if (strlen(name) <= 0)
{
MessageBox(m_hWnd "没有配置Name" "错误" MB_OK | MB_ICONERROR);
return;
}
var selidx = m_ZoneIDComboBox.getCurSel();
var zoneid = m_ZoneID[selidx];
var json = new Json();
json.add("AccountID" playerId);
json.add("displayName" str_convert(name "utf-8" "ascii"));
json.add("QQ" QQ);
json.add("ZoneID" zoneid);
var jsonstr = json.toJsonString();
//print jsonstr;
var f = new File(path "/qweqweqwelin.lol.txt" "w");
f.write(jsonstr);
f.close();
}
function onGameBegin()
{
Save();
var path = m_PathEditBox.getWindowText();
if (strlen(path) <= 0)
{
MessageBox(m_hWnd "没有配置路径" "错误" MB_OK | MB_ICONERROR);
return;
}
var playerId = m_PlayerIDEditBox.getWindowText();
if (strlen(playerId) <= 0)
{
MessageBox(m_hWnd "没有配置PlayerID" "错误" MB_OK | MB_ICONERROR);
return;
}
var name = m_PlayerNameEditBox.getWindowText();
if (strlen(name) <= 0)
{
MessageBox(m_hWnd "没有配置Name" "错误" MB_OK | MB_ICONERROR);
return;
}
var gameid = m_GameIDEditBox.getWindowText();
if (strlen(gameid) <= 0)
{
MessageBox(m_hWnd "没有配置GameID" "错误" MB_OK | MB_ICONERROR);
return;
}
var selidx = m_ZoneIDComboBox.getCurSel();
var zoneid = m_ZoneID[selidx];
var gameseldix = m_GameModeComboBox.getCurSel();
var gamemode = m_GameMode[gameseldix];
var json = new Json();
json.add("AccountID" playerId);
json.add("displayName" str_convert(name "utf-8" "ascii"));
json.add("GameMode" gamemode);
json.add("ZoneID" zoneid);
json.add("GameID" gameid);
var jsonstr = json.toJsonString();
//print jsonstr;
var f = new File(path "/q124q54dtbeg.lol.txt" "w");
f.write(jsonstr);
f.close();
}
function onGameEnd()
{
Save();
var path = m_PathEditBox.getWindowText();
if (strlen(path) <= 0)
{
MessageBox(m_hWnd "没有配置路径" "错误" MB_OK | MB_ICONERROR);
return;
}
var QQ = m_QQEditBox.getWindowText();
if (strlen(QQ) <= 0)
{
MessageBox(m_hWnd "没有配置QQ号" "错误" MB_OK | MB_ICONERROR);
return;
}
var playerId = m_PlayerIDEditBox.getWindowText();
if (strlen(playerId) <= 0)
{
MessageBox(m_hWnd "没有配置PlayerID" "错误" MB_OK | MB_ICONERROR);
return;
}
var name = m_PlayerNameEditBox.getWindowText();
if (strlen(name) <= 0)
{
MessageBox(m_hWnd "没有配置Name" "错误" MB_OK | MB_ICONERROR);
return;
}
var gameid = m_GameIDEditBox.getWindowText();
if (strlen(gameid) <= 0)
{
MessageBox(m_hWnd "没有配置GameID" "错误" MB_OK | MB_ICONERROR);
return;
}
var selidx = m_ZoneIDComboBox.getCurSel();
var zoneid = m_ZoneID[selidx];
var gameseldix = m_GameModeComboBox.getCurSel();
var gamemode = m_GameMode[gameseldix];
var gamequeuetype = m_QueueType[gameseldix];
var json = new Json();
json.add("AccountID" playerId);
json.add("GameMode" gamemode);
json.add("GameQueueType" gamequeuetype);
json.add("GameID" gameid);
json.add("QQ" QQ);
json.add("displayName" str_convert(name "utf-8" "ascii"));
json.add("ZoneID" zoneid);
var teamobj = json.addObject("team");
var team1 = teamobj.addArray("1");
for (var i = 0; i < 5 ; i )
{
var id = m_Team1ID[i].getWindowText();
var name = m_Team1Name[i].getWindowText();
var pobj = team1.pushObject();
pobj.add("AccountID" id);
pobj.add("Name" str_convert(name "utf-8" "ascii"));
}
var team2 = teamobj.addArray("2");
for (var i = 0; i < 5 ; i )
{
var id = m_Team2ID[i].getWindowText();
var name = m_Team2Name[i].getWindowText();
var pobj = team2.pushObject();
pobj.add("AccountID" id);
pobj.add("Name" str_convert(name "utf-8" "ascii"));
}
var win = m_WinCheckBox.getCheck();
if (gamemode == "TFT")
{
json.add("Rank" win);
}
else
{
json.add("BattleResult" win);
var ranksel = m_RankComboBox.getCurSel();
var rankname = m_RankName[ranksel];
json.add("RankName" rankname);
var killcnt = INT(m_killcntEditBox.getWindowText());
var assists = INT(m_assistsEditBox.getWindowText());
var deaths = INT(m_deathsEditBox.getWindowText());
var killspree = INT(m_killspreeEditBox.getWindowText());
var killmul = INT(m_killmulEditBox.getWindowText());
var gold = INT(m_GoldEditBox.getWindowText());
var minionskill = INT(m_minionskillEditBox.getWindowText());
json.add("ASSISTS" assists);
json.add("CHAMPIONS_KILLED" killcnt);
json.add("GOLD_EARNED" gold);
json.add("LARGEST_KILLING_SPREE" killspree);
json.add("LARGEST_MULTI_KILL" killmul);
json.add("MINIONS_KILLED" minionskill);
json.add("NUM_DEATHS" deaths);
var gradesel = m_GradeComboBox.getCurSel();
if (gradesel > 0)
{
var grade = m_GradeComboBox.GetLBText(gradesel);
json.add("playerGrade" grade);
}
}
var jsonstr = json.toJsonString();
var f = new File(path "/q124dsaf32end.lol.txt" "w");
f.write(jsonstr);
f.close();
}
function Init()
{
var f = new File(GetRoot() "/config.cfg");
if(!f.exists())
{
f.close();
return;
}
var jsonstr = f.read();
f.close();
var json = new Json(jsonstr);
var zonesel = json.get("zonesel");
var qq = json.get("qq");
var playerid = json.get("playerid");
var name = json.get("name");
var ranksel = json.get("ranksel");
var modesel = json.get("modesel");
var win = json.get("win");
var gradesel = json.get("gradesel");
var gameid = json.get("gameid");
var path = json.get("path");
var killcnt = json.get("killcnt");
var assists = json.get("assists");
var deaths = json.get("deaths");
var killspree = json.get("killspree");
var killmul = json.get("killmul");
var gold = json.get("gold");
var minionskill = json.get("minionskill");
m_ZoneIDComboBox.setCurSel(zonesel);
m_QQEditBox.setWindowText(qq);
m_PlayerIDEditBox.setWindowText(playerid);
m_PlayerNameEditBox.setWindowText(name);
m_RankComboBox.setCurSel(ranksel);
m_GameModeComboBox.setCurSel(modesel);
m_WinCheckBox.setCheck(win);
m_GradeComboBox.setCurSel(gradesel);
m_GameIDEditBox.setWindowText(gameid);
m_PathEditBox.setWindowText(path);
m_killcntEditBox.setWindowText(killcnt);
m_assistsEditBox.setWindowText(assists);
m_deathsEditBox.setWindowText(deaths);
m_killspreeEditBox.setWindowText(killspree);
m_killmulEditBox.setWindowText(killmul);
m_GoldEditBox.setWindowText(gold);
m_minionskillEditBox.setWindowText(minionskill);
var team1 = json.get("team1");
for (var i = 0; i < 5 ; i )
{
var pobj = team1.get(i);
var id = pobj.get("id");
var name = pobj.get("name");
m_Team1ID[i].setWindowText(id);
m_Team1Name[i].setWindowText(name);
}
var team2 = json.get("team2");
for (var i = 0; i < 5 ; i )
{
var pobj = team2.get(i);
var id = pobj.get("id");
var name = pobj.get("name");
m_Team2ID[i].setWindowText(id);
m_Team2Name[i].setWindowText(name);
}
}
function Save()
{
var zonesel = m_ZoneIDComboBox.getCurSel();
var qq = m_QQEditBox.getWindowText();
var playerid = m_PlayerIDEditBox.getWindowText();
var name = m_PlayerNameEditBox.getWindowText();
var ranksel = m_RankComboBox.getCurSel();
var modesel = m_GameModeComboBox.getCurSel();
var win = m_WinCheckBox.getCheck();
var gradesel = m_GradeComboBox.getCurSel();
var gameid = m_GameIDEditBox.getWindowText();
var path = m_PathEditBox.getWindowText();
var killcnt = m_killcntEditBox.getWindowText();
var assists = m_assistsEditBox.getWindowText();
var deaths = m_deathsEditBox.getWindowText();
var killspree = m_killspreeEditBox.getWindowText();
var killmul = m_killmulEditBox.getWindowText();
var gold = m_GoldEditBox.getWindowText();
var minionskill = m_minionskillEditBox.getWindowText();
var json = new Json();
json.add("zonesel" zonesel);
json.add("qq" qq);
json.add("playerid" playerid);
json.add("name" name);
json.add("ranksel" ranksel);
json.add("modesel" modesel);
json.add("win" win);
json.add("gradesel" gradesel);
json.add("gameid" gameid);
json.add("path" path);
json.add("killcnt" killcnt);
json.add("assists" assists);
json.add("deaths" deaths);
json.add("killspree" killspree);
json.add("killmul" killmul);
json.add("gold" gold);
json.add("minionskill" minionskill);
var team1 = json.addArray("team1");
for (var i = 0; i < 5 ; i )
{
var id = m_Team1ID[i].getWindowText();
var name = m_Team1Name[i].getWindowText();
var pobj = team1.pushObject();
pobj.add("id" id);
pobj.add("name" name);
}
var team2 = json.addArray("team2");
for (var i = 0; i < 5 ; i )
{
var id = m_Team2ID[i].getWindowText();
var name = m_Team2Name[i].getWindowText();
var pobj = team2.pushObject();
pobj.add("id" id);
pobj.add("name" name);
}
var f = new File(GetRoot() "/config.cfg" "w");
f.write(json.toJsonString());
f.close();
}
}
function main()
{
//Sleep(1000 * 10);
var consolWin = GetConsoleWindow();
//ShowWindow(consolWin SW_HIDE);
var win = new LolToolsWin();
win.run();
}
完整效果: