Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Recensione HONOR Magic V6: spessore record e super batteria. È lui il fold da battere?
Recensione HONOR Magic V6: spessore record e super batteria. È lui il fold da battere?
HONOR Magic V6 è arrivato in Italia a 2.299,90 euro con una promessa precisa: unire 4 mm di spessore da aperto (8,75 mm chiuso nel modello White, 9 mm negli altri colori) a una batteria da 6.660 mAh, la più capiente mai vista su un pieghevole. Lo abbiamo usato per oltre una settimana in versione Red 16/512 GB per capire se lo Snapdragon 8 Elite Gen 5 tiene testa alla concorrenza anche fuori dai benchmark ufficiali
Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni
Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni
Redmi Pad 2 9.7 punta su un display ampio e fluido, una batteria capace di accompagnare l'uso quotidiano senza ansie da ricarica e un prezzo accessibile, a partire da 179,90 euro per la versione con 64 GB di storage. Lo Snapdragon 6s 4G Gen 2 e i 4 GB di RAM della configurazione più diffusa frenano però chi cerca reattività e multitasking spinto: ecco il bilancio dopo due settimane di prova diretta
Peugeot Polygon Concept: ecco il futuro delle utilitarie
Peugeot Polygon Concept: ecco il futuro delle utilitarie
Polygon è la concept car di Peugeot che mostra il futuro delle soluzioni del segmento B: tra design compatti e innovativi affiancati da dimensioni compatte uno scherzo dalla manovrabilità incredibile per le manovre a bassa velocità
Tutti gli articoli Tutte le news

Vai al Forum
Discussione Chiusa
 
Strumenti
Old 18-02-2008, 22:45   #1
rockdaaga
Junior Member
 
Iscritto dal: Feb 2008
Messaggi: 1
codice msn

salve a tutti, volevo chiedere una cosa: ho questo codice qui sotto che mi crea in msn un bot che parla al posto mio....mettendo una serie di risposte automatiche mi accorgo che c'è un limite nel case...e arrivati sui 1000 e qualcosa caratteri non mi fà più scrivere... come posso allargare a quanto voglio io questo massimo di caratteri?
grazie in anticipo della gentilezza.O comunque sia se non potete aiutarmi grazie mille dell'ascolto e dello spazio concessomi


//Global Vars
var alWnd = null;//Answer List
var hWnd = null;//Help
var aeWnd = null;//Add/Edit
var sWnd = null;//Status
var pWnd = null;//ChatWnd
var ReplyNum = new Array();
var _TYPE = new Array("Fragment","Word","Sentence","RegExp");
var _WHO = new Array("Contact","Self","Both");
var _CASE = 1;
var _GLOBAL = 2;
var _MULTILINE = 4;
var _CONTACT = 8;
var _SELF = 16;
var _FIRST = 32;
var _LAST = 64;
var _WHOLE = 128;
var _RAND = 256;
var _STATUS = new Array("1","2","4","8","16","32","64","128");
var StopAll = 0;
var SW_HIDE = 0;
var SW_SHOW = 5;
var LB_SETSEL = 0x185;
var LB_GETSELCOUNT = 0x190;
var LB_GETSELITEMS = 0x191;
var Enabled = 1;
var tmrIdx = 0;
var GlobalDelay = 0;
var DAnswer = "";
var bullets = 1;
var reg=0;
var caca = 1;

function OnGetScriptMenu(iLocation){
var sMenu = "<ScriptMenu>";
sMenu += "<MenuEntry Id=\"Configure\">Configure Answers</MenuEntry>";
if(Enabled)
sMenu += "<MenuEntry Id=\"EnabledToggle\">Disable Answering</MenuEntry>";
else
sMenu += "<MenuEntry Id=\"EnabledToggle\">Enable Answering</MenuEntry>";
sMenu += "<MenuEntry Id=\"About\">About</MenuEntry>";
sMenu += "</ScriptMenu>";
return sMenu;
}

function BuildWindow() {
if(alWnd == null) {
alWnd = MsgPlus.CreateWnd("Dialog.xml","Configure");
PopulateWindow();
}
}
function PopulateWindow() {
var iCount = alWnd.LstView_GetCount("LsvAnswers");
//Remove old Entries
for(var h = 0; h<iCount; h++)
alWnd.LstView_RemoveItem("LsvAnswers",0);
//Populate ListView with New Entries
for(var j = 0; j<_TYPE.length; j++) {
var aData = GetXMLInfo(_TYPE[j]);
for(var i = 0; i<aData.length; i++) {
var idx = alWnd.LstView_AddItem("LsvAnswers", aData[i][0],j);
alWnd.LstView_SetItemText("LsvAnswers", idx, 1, aData[i][1]);
alWnd.LstView_SetItemText("LsvAnswers", idx, 2, aData[i][2]);
alWnd.LstView_SetItemText("LsvAnswers", idx, 3, aData[i][3]);
alWnd.LstView_SetItemText("LsvAnswers", idx, 4, aData[i][4]);
alWnd.LstView_SetCheckedState("LsvAnswers", idx, aData[i][6]);
}
}
var GDelay = xmlReadDelay();
alWnd.Button_SetCheckState("ChkGlobalDelay",((GDelay[0] === "1") ? true : false));
alWnd.SetControlText("EdtGlobalDelay",GDelay[1]);
}

function BuildEditWindow(iIdx) {
if(!checkXMLExists()) {
PopulateWindow();
return;
}
if(aeWnd != null) return;
aeWnd = MsgPlus.CreateWnd("Dialog.xml","AddEdit");
//Change Title of Window
Interop.Call('user32', 'SetWindowTextW', aeWnd.Handle, "Edit Answer");

//Set Properties
for(var i = 0; i<_TYPE.length; i++)
aeWnd.Combo_AddItem("CmbBoxType",_TYPE[i],i);

for(var i = 0; i<_WHO.length; i++)
aeWnd.Combo_AddItem("CmbBoxWho",_WHO[i],i);

aeWnd.Combo_SetCurSel("CmbBoxType",alWnd.LstView_GetItemData("LsvAnswers",iIdx));
aeWnd.Button_SetCheckState("RdoEdit",true);
aeWnd.SetControlText("EdtOldName",alWnd.LstView_GetItemText("LsvAnswers",iIdx,0));
aeWnd.SetControlText("EdtName",alWnd.LstView_GetItemText("LsvAnswers",iIdx,0));
aeWnd.SetControlText("EdtReceive",alWnd.LstView_GetItemText("LsvAnswers",iIdx,1));
aeWnd.SetControlText("EdtAnswer",alWnd.LstView_GetItemText("LsvAnswers",iIdx,2));
aeWnd.SetControlText("EdtMatchCount",getValue(alWnd.LstView_GetItemText("LsvAnswers",iIdx,0),"MatchCount",1));
aeWnd.SetControlText("EdtStatuses",getValue(alWnd.LstView_GetItemText("LsvAnswers",iIdx,0),"Status",255));
aeWnd.SetcontrolText("EdtDelay",getValue(alWnd.LstView_GetItemText("LsvAnswers",iIdx,0),"Delay",0));

var flags = alWnd.LstView_GetItemText("LsvAnswers",iIdx,4);
if(flags & _CASE) aeWnd.Button_SetCheckState("ChkCase",true);
if(flags & _RAND) aeWnd.Button_SetCheckState("ChkRandomize",true);
if(flags & _GLOBAL) {
aeWnd.Button_SetCheckState("ChkGlobal",true);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('LblMatchCount'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('EdtMatchCount'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('LblMatchCount2'), SW_SHOW);
}
if(flags & _MULTILINE) aeWnd.Button_SetCheckState("ChkMultiline",true);
if(flags & _WHOLE) aeWnd.Button_SetCheckState("ChkWholeMessage",true);
if(flags & _FIRST) aeWnd.Button_SetCheckState("RdoFWord",true);
else if(flags & _LAST) aeWnd.Button_SetCheckState("RdoLWord",true);
else aeWnd.Button_SetCheckState("RdoAnyWord",true);

if((flags & _SELF) && (flags & _CONTACT)) aeWnd.Combo_SetCurSel("CmbBoxWho",2);
else if(flags & _CONTACT) aeWnd.Combo_SetCurSel("CmbBoxWho",0);
else aeWnd.Combo_SetCurSel("CmbBoxWho",1);

//Determine which controls to show
switch(aeWnd.GetControlText("CmbBoxType")) {
case "RegExp":
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoFWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoLWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoAnyWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkWholeMessage'), SW_HIDE);

Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkMultiline'), SW_SHOW);
break;
case "Sentence":
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkMultiline'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoFWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoLWord'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoAnyWord'), SW_HIDE);

Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkWholeMessage'), SW_SHOW);
break;
case "Fragment":
case "Word":
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkMultiline'), SW_HIDE);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('ChkWholeMessage'), SW_HIDE);

Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoFWord'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoLWord'), SW_SHOW);
Interop.Call('user32', 'ShowWindow', aeWnd.GetControlHandle('RdoAnyWord'), SW_SHOW);
break;
}

}

//aData[i][0] = Name(String)
//aData[i][1] = Receive(String)
//aData[i][2] = Answer(String)
//aData[i][3] = Type(String)
//aData[i][4] = Flags(Bitwise Integer)
//aData[i][5] = MatchCount(Integer)
//aData[i][6] = Enabled(Integer:0-1)
//aData[i][7] = Status(Bitwise Integer)
//aData[i][8] = Delay(Integer)
function CheckMessage(sOrigin,sMessage,Wnd) {
//Loop through and check each message
for(var j = 0; j<_TYPE.length; j++) {
var aData = GetXMLInfo(_TYPE[j]);
for(var i = 0; i<aData.length; i++) {
//Debug.Trace("Loop: "+j+" Interation: "+i);
if(aData[i][6] === 0) continue;
if(!(aData[i][7] & _STATUS[Messenger.MyStatus-2])) continue;
var sReceive = aData[i][1];
var sAnswer = aData[i][2];
var sName = aData[i][0];
var Type = aData[i][3];
var iFlags = aData[i][4];
var iMatchCount = aData[i][5];
var iDelay = aData[i][8];
var bRandomize = false;
if(iFlags & _RAND) bRandomize = true;
var RegFlags = "";
if(!(iFlags & _SELF))
if(sOrigin === Messenger.MyName)
continue;

if(!(iFlags & _CONTACT))
if(sOrigin !== Messenger.MyName)
continue;

if(iFlags & _GLOBAL) RegFlags += "g";
if(iFlags & _CASE) RegFlags += "i";

var RegEx;
//Create Searches
switch(Type) {
case "Fragment":
if(iFlags & _FIRST) sReceive = "^"+sReceive+".+";
else if(iFlags & _LAST) sReceive = ".+" + sReceive + "$";
RegEx = new RegExp(sReceive,RegFlags);
break;
case "Word":
if(iFlags & _FIRST) sReceive = "^"+sReceive+".+\\b";
else if(iFlags & _LAST) Receive = "\\b.+"+sReceive+"$";
else sReceive = "\\b.+"+sReceive+".+\\b";
RegEx = new RegExp(sReceive,RegFlags);
break;
case "Sentence":
if(iFlags & _WHOLE) sReceive = "^"+sReceive+"$";
RegEx = new RegExp(sReceive,RegFlags);
break;
case "RegExp":
if(iFlags & _MULTILINE) RegFlags += "m";
if(!(iFlags & _GLOBAL)) RegFlags += "g";
RegEx = new RegExp(sReceive,RegFlags);
reg = 1;
break;
}

//Match them
var Matches = sMessage.match(RegEx);
if(Matches != null)
{
if(sMessage.match("^!shoot$"))
{
if(Math.ceil(Math.random()*6)<=bullets)
{
Wnd.SendMessage("BANG ! U DIED ! You had "+((bullets/6)*100)+"% chances to die");
StopAll = 1; //Stop replies for 1 second to reduce likelyhood of spam.
MsgPlus.AddTimer("Stop",1000);
bullets=1;
}
else
{
if(bullets<5)
{
bullets++;
Wnd.SendMessage("*Clic*, You survive and you add a bullet into the gun. (Bullets in gun: "+bullets+")");
}
else
{
Wnd.SendMessage("*Clic*, Congratulation, You survive to russian roulette !");
bullets=1;
}
StopAll = 1; //Stop replies for 1 second to reduce likelyhood of spam.
MsgPlus.AddTimer("Stop",1000);
}
return;
}
if(reg === 1)
{
sAnswer = sMessage.replace(RegEx,sAnswer);
reg = 0;
}
var sOrigin2 = sOrigin;
if( sOrigin2.length > 15)
{
sOrigin2 = sOrigin2.substring(0,15) + "..."
sOrigin2 = sOrigin2.replace("|", "%%temp%%");
}
sAnswer = sAnswer.replace("TELLER",sOrigin2);
if(Matches.length >= iMatchCount || !(iFlags & _GLOBAL))
{
//Randomize! or not.
var Answers = sAnswer.split("|");
if(bRandomize) {
if(Answers.length > 1) sAnswer = Answers[Math.round(Math.random()*(Answers.length-1))];
} else {
if(ReplyNum[i] == null || ReplyNum[i] == undefined) ReplyNum[i] = 0;
if(Answers.length > 1) sAnswer = Answers[ReplyNum[i]++];
if(ReplyNum[i] === Answers.length) ReplyNum[i] = 0;
}

if(!GlobalDelay)
iDelay = Math.abs(Math.round((iDelay>100) ? iDelay : iDelay*1000));
else {
var gDelay = xmlReadDelay();
iDelay = Math.abs(Math.round((gDelay[1]>100) ? gDelay[1] : gDelay[1]*1000));
}
//We don't like 100second+ delays.
if(iDelay > 100000)
iDelay = 100000;
if(iDelay < 0)
iDelay = 0;
if(iDelay === 0) {
sAnswer = sAnswer.replace("%%temp%%", "|");
Wnd.SendMessage(sAnswer);
StopAll = 1; //Stop replies for 1 second to reduce likelyhood of spam.
MsgPlus.AddTimer("Stop",1000);
} else {
sAnswer = sAnswer.replace("%%temp%%", "|");
pWnd = Wnd;
DAnswer = sAnswer;
MsgPlus.AddTimer("Delay",iDelay);
StopAll = 1;
MsgPlus.AddTimer("Stop",iDelay+1000);
}
return;
}
}
}
}
}

Ultima modifica di rockdaaga : 18-02-2008 alle 22:47.
rockdaaga è offline  
Old 19-02-2008, 10:05   #2
cionci
Senior Member
 
L'Avatar di cionci
 
Iscritto dal: Apr 2000
Città: Vicino a Montecatini(Pistoia) Moto:Kawasaki Ninja ZX-9R Scudetti: 29
Messaggi: 53971
Thread chiuso
|
V
cionci è offline  
 Discussione Chiusa


Recensione HONOR Magic V6: spessore record e super batteria. È lui il fold da battere? Recensione HONOR Magic V6: spessore record e sup...
Redmi Pad 2 9.7: ampio display, economico e peso contenuto, ma qualche limite nelle prestazioni Redmi Pad 2 9.7: ampio display, economico e peso...
Peugeot Polygon Concept: ecco il futuro delle utilitarie Peugeot Polygon Concept: ecco il futuro delle ut...
Reno16 Pro: il compatto di OPPO punta su fotocamera da 200MP e il nuovo Bubble! La recensione Reno16 Pro: il compatto di OPPO punta su fotocam...
 Hisense 55U7SE: tuttofare e accessibile, il MiniLED per film, sport e gioco Hisense 55U7SE: tuttofare e accessibile, il Min...
SpaceX Starship: Super Heavy Booster 20 ...
Questa RTX 3070 è tornata in vita...
Un ricercatore scopre uno script bash na...
Robot umanoidi teleoperati eseguono le p...
QuadRF, il gadget da 499 dollari che leg...
ChatGPT, Claude e Gemini nel mirino: cos...
Pneumatici dalla Cina, l'UE introduce da...
SpaceX vuole 100.000 satelliti in orbita...
Disney+ gratis, ma con pubblicità: l'ult...
Microsoft ammette: emissioni di CO2 su d...
Apple denuncia OpenAI e due ex dirigenti...
Asha Sharma licenzia migliaia di dipende...
25 articolazioni, pelle tattile e forza ...
Creato un chip quantistico in cui la mem...
Torna la migliore e-bike in carbonio del...
Chromium
GPU-Z
OCCT
LibreOffice Portable
Opera One Portable
Opera One 106
CCleaner Portable
CCleaner Standard
Cpu-Z
Driver NVIDIA GeForce 546.65 WHQL
SmartFTP
Trillian
Google Chrome Portable
Google Chrome 120
VirtualBox
Tutti gli articoli Tutte le news Tutti i download

Strumenti

Regole
Non Puoi aprire nuove discussioni
Non Puoi rispondere ai messaggi
Non Puoi allegare file
Non Puoi modificare i tuoi messaggi

Il codice vB è On
Le Faccine sono On
Il codice [IMG] è On
Il codice HTML è Off
Vai al Forum


Tutti gli orari sono GMT +1. Ora sono le: 20:22.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Served by www3v