Greasemonky Script - Saved Searchs

Archival storage to keep things organized and uncluttered. Can't find what you need? Search for old topics here.

Moderator: Tech Team

Forum rules
Please read the Community Guidelines before posting.
Selin
Posts: 1100
Joined: Wed Oct 04, 2006 7:56 am
Location: Istanbul, Turkey

Post by Selin »

This script is not working fully anymore. Can someone fix it?

On the game finder menu you had the option to save your frequently used searchs, i.e. you could save a search "active, TOP 250", name it, and you automatically got all active games of tournament TOP 250 in 1 click by choosing that specific saved search.
Now it's partially working; the options to enter a partial match/ or a tournament name in saved searchs don't work. If you don't use partial match/or tournament fields, a saved search with all other options is working, e.g. a saved search with options "waiting, flat rate, standard...." does work.

I'm not sure, if I could explain it correctly. Is it clear?
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Script Problem explained

Post by Aerial Attack »

The saved searches no longer work for "tournament" games.

This is because previously there was only a text box to do partial matches against game titles.

Now that there is a drop-down box (holding the tournament names), the script needs to be able to remember the dropdownbox.selectedvalue (NOT .selectedId ?)

Hope that explains it a little better.

EDIT: I took a look at both the Game Finder page source and the saved searches script. The script is only checking all of the input fields (text, checkbox, etc.). Meanwhile, the dropdown box is actually a select field. This means that updating will require a bit more than just 2 or 3 new lines of code to adjust. My javascript is REALLY rusty - so, I couldn't quite make it work [plus, I have no place to host the updated code].
Last edited by Aerial Attack on Wed Aug 22, 2007 2:45 pm, edited 1 time in total.
Selin
Posts: 1100
Joined: Wed Oct 04, 2006 7:56 am
Location: Istanbul, Turkey

Re: Script Problem explained

Post by Selin »

Aerial Attack wrote:The saved searches no longer work for "tournament" games.

This is because previously there was only a text box to do partial matches against game titles.

Now that there is a drop-down box (holding the tournament names), the script needs to be able to remember the dropdownbox.selectedvalue (NOT .selectedId ?)

Hope that explains it a little better.


That's an explanation, not a solution :)

.
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Potential Solution?

Post by Aerial Attack »

NOTE: I have not tested this code in any way shape or form.

I have added a few lines to the LoadSearch and SaveSearch event handlers. These have been commented out, but you may comment them back in for testing purposes/usage.

// The Save Button Handler
var saveButtonHandler = function saveButtonHandler()
{
var name= prompt("Please Name this search (reusing a name will overwrite it)",loadedName);
if (name!="" && name != null)
{
var searchDetails=new Object();
var allP = document.getElementById('middleColumn').getElementsByTagName("input");
// var count = 0;
// var tourney = document.getElementById('middleColumn').getElementsByTagName("select");
for( i in allP )
{
if(allP[i].type=="checkbox")
{
searchDetails[allP[i].id] = allP[i].checked;
}
if(allP[i].type=="text")
{
searchDetails[allP[i].id] = allP[i].value;
}
// count++;
}
// searchDetails[count] = tourney.selectedIndex;
myOptions[name] = searchDetails;
serialize("SEARCHES", myOptions);
showSearchs();
}
}

// The Load Button Handler
var loadButtonHandler = function loadButtonHandler(searchDetails,s,bRun)
{
loadedName = s;
var allP = document.getElementById('middleColumn').getElementsByTagName("input");
// var count = 0;
for( i in allP )
{
if(allP[i].type=="checkbox")
{
if ( typeof(searchDetails[allP[i].id]) != "undefined" )
{
allP[i].checked = searchDetails[allP[i].id] ;
}
else
{
// We dont have this checkbox in the saved search
// So treat it as "False" and add it to the saved search
allP[i].checked = false;
searchDetails[allP[i].id] = false;
myOptions[s] = searchDetails;
serialize("SEARCHES", myOptions);
}
}
if(allP[i].type=="text")
{
if( typeof(searchDetails[allP[i].id]) != "undefined" )
{
allP[i].value = searchDetails[allP[i].id];
}
else
{
// We dont have this textbox in the saved search
// So treat it as "" and add it to the saved search
allP[i].value = "";
searchDetails[allP[i].id] = "";
myOptions[s] = searchDetails;
serialize("SEARCHES", myOptions);
}
}
// count++;
}
// var tourneyId = document.getElementById('middleColumn').getElementsByTagName("select");
// tourneyId.selectedIndex = searchDetails[count];
if (bRun)
{
searchButton.click();
}
}
User avatar
Han Solo
Posts: 34
Joined: Thu Aug 30, 2007 3:50 am

Re: New Greasemonky Script - Saved Searchs

Post by Han Solo »

Saved Searches Script by stocksr
Adds a "Bookmark this search" button to the Game Finder
http://www.conquerclub.com/forum/viewtopic.php?t=18815

other people have the same problem : after loading the last Firefox update 2 days ago, this script has stopped working.

any solution ? this is a very helpful tool.

Thx,
Han Solo

ps : Posted in the Bugs Forums 2 days ago, but got no reaction.
Selin
Posts: 1100
Joined: Wed Oct 04, 2006 7:56 am
Location: Istanbul, Turkey

Re: New Greasemonky Script - Saved Searchs

Post by Selin »

Han Solo wrote:Saved Searches Script by stocksr
Adds a "Bookmark this search" button to the Game Finder
http://www.conquerclub.com/forum/viewtopic.php?t=18815

other people have the same problem : after loading the last Firefox update 2 days ago, this script has stopped working.

any solution ? this is a very helpful tool.

Thx,
Han Solo

ps : Posted in the Bugs Forums 2 days ago, but got no reaction.


I have the same problem :(

In fact, it was very useful.

.
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

Hey all,

I don't know what I did, but I spent some time on the situation and it works for me - I make no guarantees about anything (NOTE: I added the functionality to save Tournament Name too - no more scrolling through tourney drop down). The update to player.php instead of playerspace.php to match lack's changes fixes the old Saved Searches, if you don't trust this code.

EDIT: I have created an account on userscripts.org

Here is the Saved Searches link
Last edited by Aerial Attack on Thu Nov 08, 2007 10:42 am, edited 8 times in total.
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
Frop
Posts: 1201
Joined: Thu May 10, 2007 3:02 pm

Post by Frop »

Actually you can just use the current script. Right click on the monkey icon -> Manage User Scripts and select 'Conquer Club - Saved Searches'. Change the Included Pages to 'http://www.conquerclub.com/player.php?mode=find*'.
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

Okay - I'm not sure how/if I updated mine to have the correct included page. But mine does allow you to use the tournament drop down now in your saved searches (wasn't previously an option).

EDIT: Okay - should be working now. I've updated the above post with the appropriate included page section.
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
Han Solo
Posts: 34
Joined: Thu Aug 30, 2007 3:50 am

Post by Han Solo »

thanks a lot guys :-):-):-)
User avatar
thespider
Posts: 8
Joined: Tue May 01, 2007 7:54 pm

Saved Searches

Post by thespider »

Is this working with the 2.0.0.9 Firefox?
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Re: Saved Searches

Post by Aerial Attack »

thespider wrote:Is this working with the 2.0.0.9 Firefox?

I assume so. That's the version of Firefox I'm running.
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
MarVal
Posts: 3823
Joined: Sat Nov 11, 2006 4:45 pm
Location: De Veroveraars der Lage Landen

Post by MarVal »

It doesn't work for me. Every time I login on CC and I go to the Game Finder page and click on my saved search, I load evrytime another torunament and not the one I've saved?

Can you tell me what I'm doing wrong?

I put in: http://www.conquerclub.com/player.php?mode=find*
I work with Firefox 2.0.0.9
And greasemonkey is on.

I hope you can help me with this.

Grtz
MarVal
Image highest score: 2157 (Major) / Verd ori'shya beskar'gam
ImageImage
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

I think I know what's going on.

I'm using Selected Index which should not be affected by alphabetical ordering, but it might be. Therefore, every time they add a new tournament above yours it won't work. I'll have to verify my assumption (and change the code).

EDIT: I have changed the code and uploaded it to the userscripts.org page. All I need now is to have a tournament added or removed and I can finish testing.

- Aerial Attack
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

New Version 2.12 is available. This handles the situation where a tournament (alphabetically before yours) is added or removed. Also alerts you if a tournament has been removed.
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
MarVal
Posts: 3823
Joined: Sat Nov 11, 2006 4:45 pm
Location: De Veroveraars der Lage Landen

Post by MarVal »

I'll download and install the new version. But it doesn't seem to work.
Instead of the old one were I can click on the "Bookmark" button, I see on the new version no button at all. Only the search one.

Grtz
MarVal
Image highest score: 2157 (Major) / Verd ori'shya beskar'gam
ImageImage
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

Stupid Typos - fixed.
User avatar
MarVal
Posts: 3823
Joined: Sat Nov 11, 2006 4:45 pm
Location: De Veroveraars der Lage Landen

Post by MarVal »

Yes, it works.

And thanks for your quick replies and fix =D>

Grtz
MarVal
Image highest score: 2157 (Major) / Verd ori'shya beskar'gam
ImageImage
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

New Version uploaded.

This allows you to save Game Creation settings as well as Game Finding settings. Enjoy.

It also checks to see if you have supplied a password for tournament games (as they require one).

EDIT: Due to feedback, I have crippled the Game Creation settings saver. It only works for Tournament Game Settings for Tournament Organizers. I will let you know if/when I am allowed to re-enable this feature for general use.
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

I have added a new script that allows you to confirm if you want to drop a game. See signature link
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
gimil
Posts: 8599
Joined: Sat Mar 03, 2007 12:42 pm
Gender: Male
Location: United Kingdom (Scotland)

Post by gimil »

works perfectly :)
What do you know about map making, bitch?

natty_dread wrote:I was wrong


Top Score:2403
User avatar
remydog
Posts: 148
Joined: Wed Oct 17, 2007 7:31 pm

Post by remydog »

Aerial Attack wrote:New Version uploaded.

This allows you to save Game Creation settings as well as Game Finding settings. Enjoy.

It also checks to see if you have supplied a password for tournament games (as they require one).

EDIT: Due to feedback, I have crippled the Game Creation settings saver. It only works for Tournament Game Settings for Tournament Organizers. I will let you know if/when I am allowed to re-enable this feature for general use.


Dang! I just came looking for this very thing. Curious why they oppose it?
User avatar
MarVal
Posts: 3823
Joined: Sat Nov 11, 2006 4:45 pm
Location: De Veroveraars der Lage Landen

Post by MarVal »

Yeah, its working fine! Thanks again.

Grtz
MarVal
Image highest score: 2157 (Major) / Verd ori'shya beskar'gam
ImageImage
User avatar
Aerial Attack
Posts: 1132
Joined: Mon Jun 04, 2007 7:59 pm
Location: Generation One: The Clan

Post by Aerial Attack »

I actually have a new version in the coding/testing phase. All it really does is combine the Confirm Drop Down script - but this includes it for Game Finder (Private and Tournament Games you create) as well as Awaiting Games. The only issue is that certain special characters (in a tourney name) cause the hyper-link to go bad when you drop a game. Once I get that resolved I'll post the update.

I just realized why a Tourney Organizer would want to save Game Presets (and why I included it). In some tournaments people have different home settings - you save each person's home settings as a link (page down instead of finding and clicking each check box AND remembering the settings).
Image
My Conquer Club Scripts | Bests: 2133, #205
User avatar
PsyDev
Posts: 32
Joined: Thu May 10, 2007 12:28 pm
Gender: Male
Location: Vancouver, B.C.

Post by PsyDev »

The script actually wasn't working for me.

I tried to find out what was wrong by going to greasemonkey options in Firefox. I looked at the page that it applied to and it said:
http://www.conquerclub.com/playerspace.php?page=find*

It should have been:
http://www.conquerclub.com/player.php?mode=find

Works now.
Locked

Return to “Tool Archives”