What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » [problem] Buttons in windows

Pages: (5): « First « 1 2 [ 3 ] 4 5 » Last »
[problem] Buttons in windows
Author: Message:
NanaFreak
Scripting Contest Winner
*****


Posts: 1476
Reputation: 53
32 / Male / Flag
Joined: Jul 2006
RE: [problem] Buttons in windows
quote:
Originally posted by markee
    if(somestring.search(somearray[x]) != -1){ //search the target text for array element
make it that, not the second one that you had =\
10-24-2007 08:50 PM
Profile PM Find Quote Report
waynewilson2
Junior Member
**

Avatar

Posts: 55
Joined: Oct 2007
O.P. RE: [problem] Buttons in windows
like i said, the first one returns every string in the array, the second one returns nothing, neither is doing me any good

and the bracket is in the wrong spot...
[Image: waynewilson2@hotmail.com-12.png]
10-24-2007 10:41 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: [problem] Buttons in windows
quote:
Originally posted by waynewilson2
like i said, the first one returns every string in the array, the second one returns nothing, neither is doing me any good

and the bracket is in the wrong spot...
the bracket is in the correct spot:
code:
if(tehmess.search(filta0[x]) != -1)


are you sure that "filta0" is an Array? :P
code:
var filta0 = new Array("something here", "something there")


* roflmao456 goes to test some code

This post was edited on 10-24-2007 at 10:58 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
10-24-2007 10:54 PM
Profile PM Web Find Quote Report
waynewilson2
Junior Member
**

Avatar

Posts: 55
Joined: Oct 2007
O.P. RE: [problem] Buttons in windows
quote:
Originally posted by roflmao456
quote:
Originally posted by waynewilson2
like i said, the first one returns every string in the array, the second one returns nothing, neither is doing me any good

and the bracket is in the wrong spot...
the bracket is in the correct spot:
code:
if(tehmess.search(filta0[x]) != -1)


when i use it with the bracket in the spot that nanafreak put it in, i get an error tellin me that it expects a bracket in that line, i put another bracket anywhere, and it gives me another error...
[Image: waynewilson2@hotmail.com-12.png]
10-24-2007 10:56 PM
Profile E-Mail PM Find Quote Report
roflmao456
Skinning Contest Winner
****

Avatar

Posts: 955
Reputation: 24
30 / Male / Flag
Joined: Nov 2006
Status: Away
RE: [problem] Buttons in windows
oops! the search thing is backwards :$

code:
var filta0 = new Array("something here", "something there");
function filtaNow(tehmess){
    for(x in filta0){
        Debug.Trace("Search #" + x + ": " + filta0[x]);
        if(filta0[x].search(tehmess) != -1){
            Debug.Trace("Found Search #" + x + ": " + filta0[x]);
            }
        }
    }

that should work :P

This post was edited on 10-24-2007 at 11:07 PM by roflmao456.
[quote]
Ultimatess6
: What a noob mod
10-24-2007 11:06 PM
Profile PM Web Find Quote Report
waynewilson2
Junior Member
**

Avatar

Posts: 55
Joined: Oct 2007
O.P. RE: [problem] Buttons in windows
YAY it works now, thank you guys very much for all your help, and roflmao456, if i have any more probs, ill go straight to you first |-) :D

This post was edited on 10-25-2007 at 05:46 AM by waynewilson2.
[Image: waynewilson2@hotmail.com-12.png]
10-25-2007 01:23 AM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: [problem] Buttons in windows
Wow that's really stupid and makes me love regular expressions even more. Especially the fact that they use the string as the object and find macthes withing it.  Though I must admit that it then does get confusing trying to remember which way exec and replace go.... (or is it match.... there are too many different ways of doing things.

The way I do checks like this is as follows
code:
if((arr = RegExpObj.exec(stringObj)) !== null){
//put some code here
}
This way not only do I get the match, I get what exactly it matched and can get lots more iformation about the match (like rest ofthe string to the left or right and havig an array of all of the matches and other stuff).  I highly advise people to use this method instead.  If you don't use any symbols then you can still store all of your words in an array and what is better is that you can make sure that it is that word and not part of a word.
code:
var RegExpObj = new RegExp("\b("+arrayObj.join("|")+")\b");
or if you would prefer the word to be even in part of a word, like "hi" will be found in "this" for example with the following code (but not hte previous)
code:
var RegExpObj = new RegExp("("+arrayObj.join("|")+")");
Both of these can be really useful when coding something that the user might edit, you just need to remember the put a \ before any special symbols that will be used (eg "$", "^", ".", etc.).

This method would mean that you do not need the for statement but would just be using a regular expression in your if statemet instead.

I understand if this has just gone way over your head but other members like roflmao might find this useful for future scripts.
[Image: markee.png]
10-25-2007 12:14 PM
Profile PM Find Quote Report
waynewilson2
Junior Member
**

Avatar

Posts: 55
Joined: Oct 2007
O.P. RE: [problem] Buttons in windows
wow... you know, i did not understand a single thing out of that post, i would rather work with stuff that i can understand && work with... thanks for trying tho...oh, and, please don't try to explain it, you'll just skrew me up more...lol, i learn stuff on my own, with stuff that people teach me...
[Image: waynewilson2@hotmail.com-12.png]
10-25-2007 08:42 PM
Profile E-Mail PM Find Quote Report
markee
Veteran Member
*****

Avatar

Posts: 1622
Reputation: 50
36 / Male / Flag
Joined: Jan 2006
RE: [problem] Buttons in windows
quote:
Originally posted by waynewilson2
i learn stuff on my own, with stuff that people teach me...
I don't see how that even makes sense (just look at the logic).... :P

Anyway, just so you are aware I realised that it was beyond what you probably would understand at the moment, however this was more for the likes of roflmao and other scripters so they can continue to develop their scriptig ability.  It was my opinion that I explained what the code does in a good manner, enough for a person familiar with JScript or Javascript should understand with ease.  Regular expressions are not easy but they are far superior to searching for an exact phrase.  Personally I have never used the search method as I honestly believe you are far better spending a day or so getting used to regular expressions and using them instead.

This post was edited on 10-25-2007 at 11:23 PM by markee.
[Image: markee.png]
10-25-2007 11:21 PM
Profile PM Find Quote Report
waynewilson2
Junior Member
**

Avatar

Posts: 55
Joined: Oct 2007
O.P. RE: [problem] Buttons in windows
ok, what i meant, is that when people give me something that i ask for, i take that, and examine it for a while, and on my own, i figure out what it does, how it works, and what not...

but now i got a new problem
code:
Error: 'length' is null or not an object (code: -2146823281)

i get that error when i try to use my filtering...

code:
            if ((tehfiltabud.length >= 1000) == 0){

that is the line that its skrewing up in, i have a few lines with the .length in it, but i cannot get past that one...

thanks in advance...


and in reply to that paragraphed part, as you may have not noticed, the purpose of these posts was originally for buttons, then kept changing, umm... what else, lol... it eventually made its way to stuff like that, but when you made that post, i was looking for something to look for a partial match, not an exact...lol

This post was edited on 10-26-2007 at 02:35 AM by waynewilson2.
[Image: waynewilson2@hotmail.com-12.png]
10-26-2007 02:32 AM
Profile E-Mail PM Find Quote Report
Pages: (5): « First « 1 2 [ 3 ] 4 5 » Last »
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On