Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design
Recensione OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design
OnePlus 15 nasce per alzare l'asticella delle prestazioni e del gaming mobile. Ma non solo, visto che integra un display LTPO 1,5K a 165 Hz, OxygenOS 16 con funzioni AI integrate e un comparto foto con tre moduli da 50 MP al posteriore. La batteria da 7.300 mAh con SUPERVOOC 120 W e AIRVOOC 50 W è la ciliegina sulla torta per uno smartphone che promette di offrire un'esperienza d'uso senza alcun compromesso
AMD Ryzen 5 7500X3D: la nuova CPU da gaming con 3D V-Cache per la fascia media
AMD Ryzen 5 7500X3D: la nuova CPU da gaming con 3D V-Cache per la fascia media
Vediamo come si comporta il Ryzen 5 7500X3D, nuovo processore di casa AMD che fonde 6 core Zen 4 con la tecnologia 3D V-Cache, particolarmente utile in scenari come il gaming. Annunciato a un prezzo di listino di 279€, il nuovo arrivato sarà in grado di diventare un riferimento per i sistemi budget? Ecco cosa ne pensiamo.
SONY BRAVIA 8 II e BRAVIA Theatre System 6: il cinema a casa in formato compatto
SONY BRAVIA 8 II e BRAVIA Theatre System 6: il cinema a casa in formato compatto
Bravia 8 II rinnova l’eredità dell’A95L con maggiore luminosità e colori più precisi. Il taglio da 55” offre un’esperienza cinematografica immersiva anche in spazi ridotti, amplificata dalla soundbar Sony Theatre System 6
Tutti gli articoli Tutte le news

Vai al Forum
Discussione Chiusa
 
Strumenti
Old 18-02-2008, 23: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 23:47.
rockdaaga è offline  
Old 19-02-2008, 11: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 OnePlus 15: potenza da vendere e batteria enorme dentro un nuovo design   Recensione OnePlus 15: potenza da vendere e batt...
AMD Ryzen 5 7500X3D: la nuova CPU da gaming con 3D V-Cache per la fascia media AMD Ryzen 5 7500X3D: la nuova CPU da gaming con ...
SONY BRAVIA 8 II e BRAVIA Theatre System 6: il cinema a casa in formato compatto SONY BRAVIA 8 II e BRAVIA Theatre System 6: il c...
KTC H27E6 a 300Hz e 1ms: come i rivali ma a metà prezzo KTC H27E6 a 300Hz e 1ms: come i rivali ma a met&...
Cineca inaugura Pitagora, il supercomputer Lenovo per la ricerca sulla fusione nucleare Cineca inaugura Pitagora, il supercomputer Lenov...
Accise sui km percorsi invece che sul ca...
Offerta Amazon TOP: il richiestissimo Sa...
Qualcomm porta l'AI nei PC industriali c...
UE pensa a nuovi dazi sui pacchi low cos...
Evotrex promette la roulotte del futuro,...
AMD non teme la bolla: gli investimenti ...
Horizon Steel Frontiers: il nuovo MMORPG...
DJI Neo 2: il nuovo mini drone da 151 gr...
Svolta per le centrali a batteria: Peak ...
Truffa da 1 miliardo di dollari attraver...
Oggi il Black Friday in anticipo fa crol...
Black Friday anticipato su Amazon: sound...
ARC Raiders si espande con il nuovo aggi...
Solo svantaggi per gli utenti: Apple pro...
L'Irlanda apre un'indagine su X: sospett...
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: 23:26.


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