Torna indietro   Hardware Upgrade Forum > Software > Programmazione

Tra audio e AI: la ricetta di Qualcomm per l'agentic AI
Tra audio e AI: la ricetta di Qualcomm per l'agentic AI
Snapdragon Soung Gen 2 è la piattaforma Qualcomm per i dispositivi audio sempre più integrati nel mondo dell'intelligenza artificiale: al prorpio interno tanta potenza elaborativa per gestire al meglio le necessità d'uso dell'agentic AI
Qualcomm annuncia la nuova generazione di SoC Snapdragon 8 Elite Gen 6
Qualcomm annuncia la nuova generazione di SoC Snapdragon 8 Elite Gen 6
In occasione del proprio Snapdragon Summit Qualcomm annuncia i due nuovi chip per dispositivi mobile di fascia alta che entreranno nel mercato nel corso del 2027: tanta potenza a disposizione per elaborazioni di intelligenza artificiale sempre più complesse
realme 16 Pro Harry Potter Edition: il nuovo midrange ha uno stemma di Hogwarts che cambia colore al sole!
realme 16 Pro Harry Potter Edition: il nuovo midrange ha uno stemma di Hogwarts che cambia colore al sole!
Hogwarts arriva in fascia media grazie a realme, con una special edition che unisce la Quadra Light-Sensing Color-changing Tech, un baule in stile Hogwarts Express pieno di collezionabili e una scheda tecnica sostanzialmente identica al 16 Pro di partenza: ecco cosa cambia davvero, come si comporta nell'uso quotidiano e quanto vale in base al prezzo di 699,99 euro
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


Tra audio e AI: la ricetta di Qualcomm per l'agentic AI Tra audio e AI: la ricetta di Qualcomm per l'age...
Qualcomm annuncia la nuova generazione di SoC Snapdragon 8 Elite Gen 6 Qualcomm annuncia la nuova generazione di SoC Sn...
realme 16 Pro Harry Potter Edition: il nuovo midrange ha uno stemma di Hogwarts che cambia colore al sole! realme 16 Pro Harry Potter Edition: il nuovo mid...
Recensione REDMI Note 17 Pro: il midrange con batteria da 8.340 mAh e ricarica veloce Recensione REDMI Note 17 Pro: il midrange con ba...
Insta360 Luna Ultra: la potenza del sensore da 1 pollice incontra la portabilità estrema Insta360 Luna Ultra: la potenza del sensore da 1...
Adobe Premiere è disponibile anche su An...
Sorpresa su Amazon: ora sono 2 le e-bike...
Galaxy S27, svelate le configurazioni di...
Gli studenti americani voltano le spalle...
Mercedes-Benz e Wayve si uniscono: guida...
Meta Muse Charm: sembra un Tamagotchi, m...
Ray-Ban Meta Audio: occhiali smart senza...
Meta VR Glasses: Meta porta la realt&agr...
Meta Ray-Ban Display, gli occhiali diven...
Agente AI di OpenAI oltre i limiti: acce...
Xiaomi 18 Pro e 18 Pro Max, i nuovi flag...
ESA e Mistral hanno stretto un accordo p...
AstroForge presenta Autonomy-1: un satel...
Neutralizzata da Microsoft EvilTokens, l...
Porsche mette alla prova i Tesla Superch...
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: 07:51.


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